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

  • Home
  • SEARCH
  • 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 6255583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:23:29+00:00 2026-05-24T14:23:29+00:00

I have a c++ file that keeps throwing errors about four files up the

  • 0

I have a c++ file that keeps throwing errors about four files up the chain, while every other file using that #include compiles fine.

It keeps giving me this kind of stuff. I am certain the include file is fine as 1. All of the others which use this same file compile fine and 2. I looked at the file, and it is fine.

/usr/include/opal/opal/mediafmt.h:305:9: error: expected identifier before numeric constant
/usr/include/opal/opal/mediafmt.h:305:9: error: expected ‘}’ before numeric constant
/usr/include/opal/opal/mediafmt.h:305:9: error: expected unqualified-id before numeric constant
/usr/include/opal/opal/mediafmt.h:308:14: error: bit-field ‘mode’ with non-integral type

It’s odd because it throws the error about 5 files up the chain:

In file included from /usr/include/opal/opal/connection.h:44:0,
             from /usr/include/opal/opal/call.h:41,
             from /usr/include/opal/opal/manager.h:42,
             from /usr/include/opal/opal/endpoint.h:41,
             from /usr/include/opal/opal/localep.h:41,
             from /home/jonathan/workspace/HHPVideoServer/opal/GstEndPoint.h:12,
             from /home/jonathan/workspace/HHPVideoServer/opal/opal-call-manager.h:42,
             from ../gui/HHPVideoCodecGui.cc:3:

I checked to make sure I wasn’t screwing up any #define s but that was the only idea I had. Is there a good approach someone can offer me on how to track this error down?

Here is the file:

http://www.opalvoip.org/docs/opal-v3_9/da/d60/mediafmt_8h-source.html

Update

Here is the struct with the troublesome line from the preprocessor. I suppose the “0L” is the trouble.

struct H245GenericInfo {
  H245GenericInfo() { memset(this, 0, sizeof(*this)); }
  unsigned ordinal:16;
  enum Modes {
    0L,
    Collapsing,
    NonCollapsing
  } mode:3;
  enum IntegerTypes {
    UnsignedInt,
    Unsigned32,
    BooleanArray
  } integerType:3;
  bool excludeTCS:1;
  bool excludeOLC:1;
  bool excludeReqMode:1;
};

then

#define None 0L 

from “/usr/include/X11/X.h” causes 0L to be substituted for None in the Modes enumeration at line 305.

from the X11 lib. The reason the other files were compiling is that they weren’t also using Gtk. Does any one have a work around that doesn’t involve me rewriting either of the lib files?

solution

I just put the offending #include above everything else. Thanks for the help everyone.

  • 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-05-24T14:23:31+00:00Added an answer on May 24, 2026 at 2:23 pm

    Assuming you’re using gcc, run gcc -E your-file.c > tmpfile. This runs just the preprocessor. The output is going to be quite voluminous, but it should help you track down the problem.

    What does line 305 look like?

    EDIT:
    Given your update, yes, the problem is that “None” is being defined as a macro before your mediafmt.h tries to define it as an enumerator. Can you add #undef None after including X.h and before including mediafmt.h? (If so, be sure to comment it.)

    EDIT2: Rearranging the #include directives might be a better solution — but again, be sure to add a comment explaining the reason.

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

Sidebar

Related Questions

I have a file that I want to include in Python but the included
I have a file that I want to read in using the File::Slurp module
I have a file that apparently contains some sort of dump of a keep-alive
I have a file that lists filenames, each on it's own line, and I
We have a file that has a 64 bit integer as a string in
I have a file that has one entry per line. Each line has the
I have a file that contains a mish-mash of cities, states, and zip codes.
I have a file that I can get to with the UNC \mypath\myfile. I
I have a file that contains this kind of paths: C:\bad\foo.c C:\good\foo.c C:\good\bar\foo.c C:\good\bar\[variable
I have a file that contain huge number of net names. I would like

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.