Trouble installing Bullet in Ubuntu 8

Post Reply
op3ngl
Posts: 3
Joined: Fri Feb 25, 2011 12:17 am

Trouble installing Bullet in Ubuntu 8

Post by op3ngl »

Hi to bullet users, I'm working on an Ogre3D project, our team decided to use Bullet like Physics Engine, but We have had some troubles in the installation process. We are using Ubuntu 8 and Cmake to build (Like the Bullet Manual said), in the 98% percent of the process we get 2 errors. Any help will be apreciated, Thanks

Here some part of the error message.

[ 98%] Building CXX object Demos/ThreadingDemo/CMakeFiles/AppThreadingDemo.dir/main.o
/home/simunav/bullet-2.77/Demos/ThreadingDemo/main.cpp: In function ‘btThreadSupportInterface* createThreadSupport(int)’:
/home/simunav/bullet-2.77/Demos/ThreadingDemo/main.cpp:38: aviso: conversión obsoleta de una constante de cadena a ‘char*’
Linking CXX executable AppThreadingDemo
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixThreadSupport::sendRequest(unsigned int, unsigned long, unsigned int)':
PosixThreadSupport.cpp:(.text+0xb4): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0xc8): undefined reference to `sem_post'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `threadFunction(void*)':
PosixThreadSupport.cpp:(.text+0x12f): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0x145): undefined reference to `sem_wait'
PosixThreadSupport.cpp:(.text+0x159): undefined reference to `sem_wait'
PosixThreadSupport.cpp:(.text+0x190): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0x1a7): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0x1f7): undefined reference to `sem_post'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `createSem(char const*)':
PosixThreadSupport.cpp:(.text+0x243): undefined reference to `sem_init'
PosixThreadSupport.cpp:(.text+0x25a): undefined reference to `sem_init'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixThreadSupport::waitForResponse(unsigned int*, unsigned int*)':
PosixThreadSupport.cpp:(.text+0x2ab): undefined reference to `sem_wait'
PosixThreadSupport.cpp:(.text+0x327): undefined reference to `sem_wait'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixThreadSupport::startThreads(PosixThreadSupport::ThreadConstructionInfo&)':
PosixThreadSupport.cpp:(.text+0x44b): undefined reference to `pthread_create'
PosixThreadSupport.cpp:(.text+0x46c): undefined reference to `pthread_create'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixThreadSupport::stopSPU()':
PosixThreadSupport.cpp:(.text+0x738): undefined reference to `sem_wait'
PosixThreadSupport.cpp:(.text+0x756): undefined reference to `sem_destroy'
PosixThreadSupport.cpp:(.text+0x779): undefined reference to `pthread_cancel'
PosixThreadSupport.cpp:(.text+0x7c2): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0x7da): undefined reference to `sem_post'
PosixThreadSupport.cpp:(.text+0x810): undefined reference to `pthread_cancel'
PosixThreadSupport.cpp:(.text+0x851): undefined reference to `sem_destroy'
PosixThreadSupport.cpp:(.text+0x8bc): undefined reference to `sem_destroy'
PosixThreadSupport.cpp:(.text+0x8ef): undefined reference to `sem_wait'
PosixThreadSupport.cpp:(.text+0x91e): undefined reference to `sem_destroy'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixBarrier::setMaxCount(int)':
PosixThreadSupport.cpp:(.text._ZN12PosixBarrier11setMaxCountEi[PosixBarrier::setMaxCount(int)]+0x1c): undefined reference to `pthread_barrier_init'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixBarrier::sync()':
PosixThreadSupport.cpp:(.text._ZN12PosixBarrier4syncEv[PosixBarrier::sync()]+0x9): undefined reference to `pthread_barrier_wait'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixBarrier::~PosixBarrier()':
PosixThreadSupport.cpp:(.text._ZN12PosixBarrierD1Ev[PosixBarrier::~PosixBarrier()]+0x10): undefined reference to `pthread_barrier_destroy'
../../src/BulletMultiThreaded/libBulletMultiThreaded.a(PosixThreadSupport.o): In function `PosixBarrier::~PosixBarrier()':
PosixThreadSupport.cpp:(.text._ZN12PosixBarrierD0Ev[PosixBarrier::~PosixBarrier()]+0x10): undefined reference to `pthread_barrier_destroy'
collect2: ld devolvió el estado de salida 1
make[2]: *** [Demos/ThreadingDemo/AppThreadingDemo] Error 1
make[1]: *** [Demos/ThreadingDemo/CMakeFiles/AppThreadingDemo.dir/all] Error 2
make: *** [all] Error 2
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Trouble installing Bullet in Ubuntu 8

Post by Erwin Coumans »

This should already be fixed in latest Bullet svn trunk version, and will be fixed for the upcoming 2.78 release.

We accidently enabled the compilation for those 2 demos for unix platforms, without adding the linker flags for the pthread libraries.

You can simply add the pthread libs in the CMakeLists.txt for each demo,

IF (UNIX)
TARGET_LINK_LIBRARIES(AppThreadingDemo pthread)
ENDIF(UNIX)

or disable the demos completely:

Open the Bullet/Demos/CMakeLists.txt file with a text editor, search for
ThreadingDemo and MultiThreadedDemo and delete those lines, or add a hash mark (#) in front of them.

Hope this helps,
Erwin
op3ngl
Posts: 3
Joined: Fri Feb 25, 2011 12:17 am

Re: Trouble installing Bullet in Ubuntu 8

Post by op3ngl »

Erwin Coumans wrote:This should already be fixed in latest Bullet svn trunk version, and will be fixed for the upcoming 2.78 release.

We accidently enabled the compilation for those 2 demos for unix platforms, without adding the linker flags for the pthread libraries.

You can simply add the pthread libs in the CMakeLists.txt for each demo,

IF (UNIX)
TARGET_LINK_LIBRARIES(AppThreadingDemo pthread)
ENDIF(UNIX)

or disable the demos completely:

Open the Bullet/Demos/CMakeLists.txt file with a text editor, search for
ThreadingDemo and MultiThreadedDemo and delete those lines, or add a hash mark (#) in front of them.

Hope this helps,
Erwin
Thanks a lot Erwin, I'll try and comment the result
Post Reply