Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / Expected unqualified-id
  RSS 2.0 ATOM  
2 pages: 1.2 last

Expected unqualified-id
Rate this thread
 
60209
 
Permlink of this thread  
avatar
  • drummerp
  • Posted: 21 September 2011 04:55 AM
  • Total Posts: 9
  • Joined: 21 September 2011 04:43 AM

I downloaded the FBX SDK a while ago and have been trying to integrate it with my code for a custom importer. The problem I am running into is that when I try to compile, I get the error “expected unqualified-id before numeric constant” in 3 different places: kfbxobject.h, kfbxnode.h, and kfbxtexture.h, all in include/fbxfilesdk/kfbxplugins.

I’m using GCC 4.3.2 in Code::Blocks 10.05 on a Linux 2.6.32 x86_64 system, specifically Debian 6.0.2 (Squeeze, Stable). The errors are whenever it uses an enum called eFbxPropertyCallback:

virtual bool PropertyNotify(eFbxPropertyCallbackKFbxProperty*); //kfbxobject.h
virtual bool PropertyNotify(eFbxPropertyCallback pTypeKFbxPropertypProperty); //kfbxnode.h
virtual bool PropertyNotify(eFbxPropertyCallback pTypeKFbxPropertypProperty); //kfbxtexture.h

eFbxPropertyCallback is declared in kfbxobject (interestingly, just above the declaration for kFbxObject::PropertyNotify, as such:

// property callbacks
    
typedef enum {
        eFbxProperty_SetRequest
,
        
eFbxProperty_Set,
        
eFbxProperty_Get
    } eFbxPropertyCallback
;

I have tried searching for this error on the internet, and have found that generally it occurs due to a naming conflict. However, I know I have declared nothing of the sort in my project, and a search (using the “find” command) shows that there are only 4 places eFbxPropertyCallback anywhere in any libraries I’m using: the 4 places I’ve presented here. More importantly, if I try changing the name (I’ve tried everything from eFbxCallback to eFbxRandomEnumName) and using that in these places, I still get the same error.

Please, any help would be appreciated. I have no clue why it is doing this or how to fix it.



Replies: 0
avatar

Hi drummerp,

Possibly your issue is linked with this post: 2012.1 SDK under Ubuntu Linux?

I hope this helps,



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 1
/img/forum/dark/default_avatar.png

No, that would not seem to be related to my problem, but thanks for trying.

Author: drummerp

Replied: 21 September 2011 11:55 AM  
avatar

Hi drummerp,

Ok, I will log a bug then.
You are using FBX SDK 2012.1, right?



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 0
avatar
  • drummerp
  • Posted: 22 September 2011 04:07 PM

Yes, I’m using 2012.1. Sorry for not clarifying that.



Replies: 0
avatar
  • drummerp
  • Posted: 24 September 2011 04:41 PM

Any information on what’s going on with this? Presumably it’s been added as a trouble ticket which some developer will find at some point in the future and work on resolving? And if so, any suggestions for getting it to work in the short term?



Replies: 0
avatar

Hi drummerp,

At present, task BARB-205 is open.

I have no other suggestion than the thread already posted: 2012.1 SDK under Ubuntu Linux. It does mention that using a GCC version higher than GCC 4.1.2 might cause compilatiton errors.

I am sorry, I don’t have any other hints to help you.



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 0
avatar
  • drummerp
  • Posted: 14 October 2011 12:56 PM

If a fix is introduced based on this task, should I expect not to see it until the next version is released?



Replies: 1
/userdata/avatar/3yvwf23us_doug100x100.png

Try dumping out the C++ pre processing pass and see if that gives you any insight.

Author: Doug Rogers

Replied: 14 October 2011 01:11 PM  
avatar

Hi drummerp,

A developer investigated this case. Here is what he has to say:

First of all, we do not have eFbxPropertyCallback defined in FBX SDK 2011.3, 2012.1 or 2012.2. We are assuming that you are referring to eFbxPropertyNotify.

Our FBX developer is convinced that you are experiencing the same problems as this post, i.e: using a compiler more recent than then one we use to build FBX SDK. We build perfectly fine with gcc 4.0.2 (maybe 4.1.x too) but, clearly, gcc 4.3.x does not like the way we define the enum.

Anyway, in FBX 2013 we have changed the definition of the enums. Now, instead of :

typedef enum {
eFbxProperty_SetRequest
eFbxProperty_Set
eFbxProperty_Get
} eFbxPropertyNotify;

we have:

enum PropertyNotifyType
{
ePropertySetRequest
ePropertySet
ePropertyGet
}

The pre-processor on Linux can play nasty tricks depending on the include order of the header files. Maybe this is what is happening here. We suspect that the typedef style we use does not meet the requirements for GCC 4.3.x. With a little bit of luck, the new way we define the enum will pass better.

You could try moving some include statement, maybe they will fix the problem. It is sad to say, but we have no way of testing this, and with GCC 4.0.2 everything compiles without any errors.

Another possibily may be that you are using some compiler flags that are garbling the symbols names and make them incompatible with the FBX SDK library ?

I hope this helps,



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 1
/img/forum/dark/default_avatar.png

I had the exact same problem as drummerp after some updates (it worked before). After reading this post, I fixed the problem by changing the order of the includes, as suggested. I am using gcc 4.6.1 and everything compiles fine again, even with -std=c++0x.

Thank you.

EDIT: Finally had some time to investigate this and found the error. The problem is that one function name and one enum member are already defined in X11/X.h (I am including <GL/glxew.h>, and it includes many X11 headers).

In the following lines, “PropertyNotify” is previously defined as an integer:

-> include/fbxfilesdk/kfbxplugins/kfbxobject.h:1214:
virtual bool PropertyNotify(eFbxPropertyNotify pTypeKFbxPropertypProperty);

-> 
include/fbxfilesdk/kfbxplugins/kfbxnode.h:2106:
virtual bool PropertyNotify(eFbxPropertyNotify pTypeKFbxPropertypProperty);

-> 
include/fbxfilesdk/kfbxplugins/kfbxtexture.h:646:
virtual bool PropertyNotify(eFbxPropertyNotify pTypeKFbxPropertypProperty);

In the following line, “None” is also previously defined:

-> include/fbxfilesdk/kfbxplugins/kfbxvideo.h:212:
None,           //!< Progressive frame (full frame).

Since now you know exactly what’s wrong and it is an annoying conflict, it would be great to have it fixed for future releases. Please let us know if you intend to do something about it.

By the way, I am using FBX SDK 2012.2.

Author: ThiagoSG

Replied: 22 November 2011 12:54 PM  
avatar
  • drummerp
  • Posted: 29 October 2011 06:01 AM

Thank you very much for the help. I shall try that and get back to you shortly.

EDIT: I’m sorry, that doesn’t seem to have worked either. I might be able to switch over to GCC 4.0.3, but it would just be difficult because it would require me to rebuild every library I have, and it’ll require me to build GCC from source since the oldest version in my Debian repository is 4.3.



Replies: 0
avatar
  • drummerp
  • Posted: 06 November 2011 12:01 PM

Well, I seem to have stumbled upon a fix. Code::Blocks, by default, passes the flag --std=c++0x to GCC, causing it to use the upcoming C++0x standard. By disabling this in Build Options (which I did for a different reason), it eliminates the error. I assume that C++0x redefines the way enums are used in C++ or some such. At any rate, there’s your fix.



Replies: 0
avatar

Good to know! Thank you!



Viviane Rochon
Maya Data Platform
Autodesk

Replies: 0
2 pages: 1.2 last