ogrenewt can not use in new project

caifie

09-05-2010 11:09:02

hi, everyone!

there is a strange thing with ogrenewt2.0+ogre1.7.

situation1. create a new ogre1.7 app with the wizard, add the ogrenewt headfiles and link to the ogrenewt lib, then add the ogrenewt code from the demo, but the app can combile but can not run. it will die in the code line below,
OgreNewt::ConvexCollisionPtr col = OgreNewt::ConvexCollisionPtr(new OgreNewt::CollisionPrimitives::Box( m_World, size, 0 ));

situation2. in the ogrenewt.sln, i moved the current code of the demo, and import the same code in situation1, it can combile and can run also.

so i think that, the code may not have problems.

i then checked the property of the new ogre app and the ogrenewt demo in ogrenewt.sln, i make sure the property are the same, and try the two situation above again. the problem is the same.

ps: the demos in ogrenewt.sln include minimalogrenewtapplication can combile and run well.

anyone have the idea?

SFCBias

10-05-2010 02:07:11

try OgreNewt::ConvexCollisionPtr col(new OgreNewt::CollisionPrimitives::Box(foo,bar,0));

caifie

10-05-2010 03:57:12

thanks!

but i should point that, the same code, which can run in the ogrenewt.sln but can not run in new ogre project.

even i copy the demo code into a new ogre project, the demo code will also can combile but can not run.(ofcourse the demo code can combile and run in the ogrenewt.sln)

SFCBias

14-05-2010 16:12:57

That probably because of missing libraries or headers in the new ogre project which were included already in the OgreNewt solution file

caifie

15-05-2010 00:42:55

That probably because of missing libraries or headers in the new ogre project which were included already in the OgreNewt solution file

no, i have checked this. you should know that, the new app can combile, just will crash while run.

can combile means that already have the necessary headfiles and libs.

(and i have make sure the other property are same)

SFCBias

16-05-2010 03:10:41

Well if the code can compile & run in one app then its not a code problem so it must be something external such as libs , headers, Macro definitions(i say this because this can cause a problem sometimes where a piece of code only runs when a macro is defined). You should be sure that the OgreNewt solution and the new solution link the EXACT same things, have the exact same defines, and include the exact same headers and any other things of that nature. (im sure you get the idea)

I would try myself but I no longer run windows so, no more Visual Studio...