Include errors?

nk47
Posts: 5
Joined: Sat Apr 05, 2008 1:29 pm

Include errors?

Post by nk47 »

Hi, sorry if that is mentioned somewhere already.
i compiled the bullet src, added the libs but as soon as i include <btBulletDynamicsCommon.h>
i get 105 syntax errors in various include files. directories ARE specified correct.
what i can possibly do wrong?
thanks in advance
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Include errors?

Post by Erwin Coumans »

nk47 wrote:Hi, sorry if that is mentioned somewhere already.
i compiled the bullet src, added the libs but as soon as i include <btBulletDynamicsCommon.h>
i get 105 syntax errors in various include files. directories ARE specified correct.
what i can possibly do wrong?
There has been not such report before, please provide following info:

1) which platform, compiler, build system do you use?
When using Visual Studio, you should be able to open the bullet solution file and compile out-of-the-box. Same for CMake on other platforms.

2) which syntax errors? Please copy/paste a few lines of the errors.

Thanks,
Erwin
nk47
Posts: 5
Joined: Sat Apr 05, 2008 1:29 pm

Re: Include errors?

Post by nk47 »

Im on WinXP with MSVS 2005 (SP1).
The SDK compiles totally fine (except few warning) and i bind the compiled release/debug libs no problem.
libbulletcollision.lib
libbulletdynamics.lib
libbulletmath.lib

The errors appear after including <btBulletDynamicsCommon.h>.
The include path is set to bullet path like in the SDK its set to \src\ directory.
Errors are basically syntax errors f.e.
btCollisionObject(); // error C2059: syntax error : ')' e:\bullet\bulletcollision\collisiondispatch\btcollisionobject.h 130
btPersistentManifold(); // error C2059: syntax error : ')' e:\bullet\bulletcollision\narrowphasecollision\btpersistentmanifold.h 69
BT_DECLARE_ALIGNED_ALLOCATOR(); // error C2059: syntax error : 'return' e:\bullet\bulletcollision\collisiondispatch\btcollisionobject.h 93
BT_DECLARE_ALIGNED_ALLOCATOR(); // error C2059: syntax error : 'string' e:\bullet\bulletcollision\collisiondispatch\btcollisionobject.h 93
...
error C2061: syntax error : identifier 'btCollisionObject' e:\bullet\bulletcollision\broadphasecollision\btdispatcher.h 72
error C2062: type 'void' unexpected e:\bullet\bulletcollision\narrowphasecollision\btpersistentmanifold.h 71
error C2065: 'body0' : undeclared identifier e:\bullet\bulletcollision\narrowphasecollision\btpersistentmanifold.h 72
...

It appears like something is not including right even though it should be.
Will go over this one more time ...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Include errors?

Post by Erwin Coumans »

Haven't seen this before. There might be conflicts in earlier file includes.

Can you make sure to add the Bullet include as first line in your project/cpp file?

Are you using precompiled headerfiles?
Hope this helps,
Erwin
nk47
Posts: 5
Joined: Sat Apr 05, 2008 1:29 pm

Re: Include errors?

Post by nk47 »

I downloaded SDK again, extracted it and specified include path to bullet \src\ file.
Now it compiles fine. :| Maybe just did something wrong before. Sorry for not checking properly before posting.
Thanks alot Erwin! For reply and for this great project!
chunky
Posts: 145
Joined: Tue Oct 30, 2007 9:23 pm

Re: Include errors?

Post by chunky »

Gonna guess your compiler was having a hissy fit over the wrong newlines for your system?

Gary (-;
nk47
Posts: 5
Joined: Sat Apr 05, 2008 1:29 pm

Re: Include errors?

Post by nk47 »

whats that with wrong newlines? i have same errors on another machine.
can't really get the difference between the project setups.
any settings i should be aware of?
nk47
Posts: 5
Joined: Sat Apr 05, 2008 1:29 pm

Re: Include errors?

Post by nk47 »

solved ...
the errors occurred because of overloaded new operator in debug mode.
release builds always compiled fine. redefined new before including bullet headers in
debug mode and everything went ok.
Rademanc
Posts: 11
Joined: Mon Nov 02, 2009 11:55 am

Re: Include errors?

Post by Rademanc »

solved ...
the errors occurred because of overloaded new operator in debug mode.
release builds always compiled fine. redefined new before including bullet headers in
debug mode and everything went ok.
I have the same issue with debug/ release builds.
What do you mean "redifined new"?