0

I'm having issues with XCode, LLVM and the _DEBUG definition. Or more specifically it seems to be something with underscore.

This is the second time I'm getting an error like this. This time Im compiling against PhysX lib.

/Library/Frameworks/PhysX.framework/Versions/3.2.1/include/foundation/PxPreprocessor.h:316:35: Expected value in expression

The line it's complaining about:

#if !defined(PX_CHECKED) && _DEBUG

And it points at right after the _DEBUG. If I remove the underscore it compiles fine (I did that on a similiar library last time as well, see http://www.ogre3d.org/forums/viewtopic.php?f=2&t=78990). But now Im feeling uneasy about this error. What is causing it and what does it mean?

Settings: Dialect: C++11, libc++ (Tried different ones, like GNUC++11 Max OSX 10.8 XCode 5 LLVM 5.0

0

1 Answer 1

4

Names that begin with an underscore are reserved for the implementation. Instead, use names that don't begin with an underscore unless you are specifically trying to access some implementation-specific feature.

Use defined() on implementation specific macros:

#if !defined(PX_CHECKED) && defined(_DEBUG)

If there's some reason you are expecting this to work, you haven't explained what it is. There is no reason this should work. What are you expecting it to do?

Sign up to request clarification or add additional context in comments.

2 Comments

I'm using PhysX - It's the PhysX library that are using the _DEBUG macro. They require me to define either _DEBUG or NDEBUG in the compiler but it still won't work. Strange that they are using it ..
Oh! Then you want #if !defined(PX_CHECKED) && defined(_DEBUG)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.