Skip to content Skip to sidebar Skip to footer

C++ Static Const Multiple Declaration Error In Eclipse For Android Ndk

I've read the similar questions, but the one that answers mine applies only to VisualStudio. I am using Eclipse and developing an Android application using Cocos2d-X, which is a fr

Solution 1:

The only way that error could occur is if you're including the .cpp file around. Else, your code is perfectly Standards-compliant. After all, the error implies that the constant was defined in Ball.o, which I find very unlikely unless you included the cpp.

Solution 2:

In your case, the names doesn't match. You are declaring as gravity and in cpp it's GRAVITY.

Edit: After your edit, I see no linking errors in your code unless you have defined GRAVITY in your Ball.cpp/h file also.

Post a Comment for "C++ Static Const Multiple Declaration Error In Eclipse For Android Ndk"