compiler conflict while compiling with bullet

Problems building or running the engine, queries about how to use features etc.
Post Reply
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

compiler conflict while compiling with bullet

Post by shome »

I have ogre rendering code which compiles well with existing c++ ie c++03, but wont compile with c++11.

I have bullet physics code which compiles well with c++11 but wont compile with c++03.

Now I want to interface them. I want to call the bullet code from the ogre main. How do I do it?

ogre version 1.81, bullet version: 2.82

I know about ogre-bullet wrapper, but I have my codes ready for bullet, I would not want to take a new route via ogre-bullet.

My Cmakelists for bullet code:

Code: Select all

SET(BULLET_PHYSICS_SOURCE_DIR ~/bullet-2.81-rev2613)
SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut)

INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src 
${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL )

link_directories(${BULLET_LIBRARIES} /usr/local/lib)

LINK_LIBRARIES(	OpenGLSupport GL glut GLU BulletDynamics  BulletCollision LinearMath  ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})

ADD_EXECUTABLE(App App.cpp)

target_link_libraries(App ${LINK_LIBRARIES} )
add_definitions(-std=c++11)
important parst of the cmakelists.txt for OGRE code:

Code: Select all

CMAKE_MINIMUM_REQUIRED (VERSION 2.8.6)

IF(UNIX)
  LIST(APPEND CMAKE_MODULE_PATH "/opt/OGRE/")
  LIST(APPEND EXTRA_LIBS "-ldl -lXt")
  ADD_DEFINITIONS(-fPIC)
ENDIF()

ADD_DEFINITIONS(
  -O3
  ) # -std=gnu++0x

SET(BUILD_SHARED_LIBS OFF)

find_package(OpenGL)
find_package(GLUT)
FIND_PACKAGE(Boost REQUIRED COMPONENTS system)
FIND_PACKAGE(OpenCV REQUIRED)

SET(OGRE_STATIC TRUE)
FIND_PACKAGE(OGRE REQUIRED)

....

hyyou
Gremlin
Posts: 173
Joined: Wed Feb 03, 2016 2:24 am
x 17
Contact:

Re: compiler conflict while compiling with bullet

Post by hyyou »

Strange, I successfully compiled Bullet with its default setting, Windows. I am using both Ogre & Bullet in the same project.

Did you download last version of Bullet?
I am using bullet-2.82-r2704.zip (with both Ogre 1.9 & 2.1 are ok, didn't test for 1.8 )
http://code.google.com/p/bullet/downloads/list

I also didn't have to write any cMake myself.

In Windows, I faced a bit difficulty - don't know if it relates to your problem.

Code: Select all

'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in Source.obj
I solved it by (Visual Studio)

Code: Select all

0Bullet > C/C++ > Code Generation > Runtime Library "multi-threaded Debug Dll"  OR "multi-thread Dll"     
It looks like that some dependencies / project setting of Bullet and Ogre are a bit different.

Edit: remove "c++11" word
Last edited by hyyou on Wed Jun 22, 2016 5:36 am, edited 1 time in total.
frostbyte
Orc Shaman
Posts: 737
Joined: Fri May 31, 2013 2:28 am
x 65

Re: compiler conflict while compiling with bullet

Post by frostbyte »

afaik neither Bullet nor Ogre use c++11...why compile it that way?
http://stackoverflow.com/questions/1263 ... ource-code
the woods are lovely dark and deep
but i have promises to keep
and miles to code before i sleep
and miles to code before i sleep..

coolest videos link( two minutes paper )...
https://www.youtube.com/user/keeroyz/videos
Post Reply