Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:51:24+00:00 2026-06-14T20:51:24+00:00

Im trying to create a global class so I can access it anywhere, but

  • 0

Im trying to create a global class so I can access it anywhere, but it’s not working, I get the error:

a storage class can only be specified for objects and functions

Does anyone know where I’m going wrong?

Here is my h file:

extern class Payments : public QObject
{
Q_OBJECT
public:
    Payments(QObject *parent = 0);
    virtual ~Payments();
    void purchase(const QString &id, const QString &sku, const QString &name, const QString &metadata);
    void getExisting(bool refresh);
    void getPrice(const QString &id, const QString &sku);

public slots:
    void purchaseResponse();
    void existingPurchasesResponse();
    void priceResponse();

signals:
    void purchaseResponseSuccess(const QString &receiptString);
    void existingPurchasesResponseSuccess(const QString &receiptsString);
    void priceResponseSuccess(const QString &price);
    void infoResponseError(int errorCode, const QString &errorText);


private:
    bb::platform::PaymentManager *paymentManager;

};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:51:26+00:00Added an answer on June 14, 2026 at 8:51 pm

    The storage-class keyword extern causes the problem. You can’t specify this for a class definition. And you don’t need it anyway: Your class definition will be accessible from anywhere (provided you #include the file it’s defined in).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a global (singleton) class that can associate any type of
I am trying to create a static global array called series. But the number
Trying to create a new Dedicated Cache Role in Windows Azure but get the
Im trying to create a website with Web.py but its not letting me open
I'm trying to create a global Robot variable in a Java class without throwing
I am trying to create a class in python which reads the access key/secret
I'm trying to create a global context variable in one of my libraries, but
I am trying to create some global variables in a firefox extension. In my
I'm trying to create a global handler that gets called before the ajax success
I am trying to create something to hold global site-wide settings in our ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.