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 7963957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:45:03+00:00 2026-06-04T05:45:03+00:00

I get these errors messages all over the place for g++ 4.1.2, and it

  • 0

I get these errors messages all over the place for g++ 4.1.2, and it doesn’t help at all:

<file>:<line>: error: expected primary-expression before 'int'
<file>:<line>: error: expected ';' before 'int'
<file>:<line>: error: invalid use of qualified-name '::SuccessCode'

The piece of code where it happens is as simple as this:

class Test
{
  static Status debug_function(void)
  {
    return Status::SuccessCode();   // this would be <file>:<line> mentioned above
    // and this one too:
    // return Status::FailureCode("test");
  }
};

And here’s the code for Status (and yes it’s properly included, because I would have an error if the include file was invalid):

namespace CODES
{
  enum Values { Success = 0, Failed = 1 };
}

class Status
{
private:
  CODES::Values code;
  string msg;
public:
  Status(CODES::Values val, const string &i_msg ): code(val), msg(i_msg) {}

  static Status SuccessCode(void)
  {
    return Status(CODES::Success, "");
  }

  static Status FailureCode(const string &fail_msg)
  {
    return Status(CODES::Failed, fail_msg);
  }
};

So, what is wrong with this piece of code ? And it compiles properly under VC++!

EDIT: Actually, the code for SuccessCode and FailureCode are in a *.cpp file. I put them in the class declaration because the error message is still the same!

  • 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-04T05:45:04+00:00Added an answer on June 4, 2026 at 5:45 am

    Without a complete program, I’ll have to guess. My guess is: you have a #define Status int somewhere in your program.

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

Sidebar

Related Questions

this is probably an include problem, i get these errors all over the code,
I get these errors when I try to compile a matrix CUBLAS operation: 1>ClCompile:
I am having trouble validating my xml schema. I get these errors on the
I am trying to build a VC++ project and I get these LINK errors:
Does anyone know what these error's mean? I get this when I click a
Hello not sure why Im getting this error. Basically I get it in these
CUDA has lots of documentation and guides all over the place, but one I
Iterating over all sheets in a Spreadsheet I ran into this error message: Unable
Sometimes I get this error message from time-based trigger of many scripts ... There
I get an exception with the message: There is an error in XML document.

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.