favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Demo AppAllBulletDemos does not compile when using shared libs #434

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. build with -DBUILD_SHARED_LIBS="ON"
2. build fails

What is the expected output? What do you see instead?

Linking CXX executable AppAllBulletDemos
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `pthread_create'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `sem_wait'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `sem_init'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `sem_destroy'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `pthread_barrier_wait'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `pthread_barrier_destroy'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `sem_post'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `pthread_barrier_init'
../../src/BulletMultiThreaded/libBulletMultiThreaded.so.2.77: undefined 
reference to `pthread_cancel'
collect2: ld returned 1 exit status

What version of the product are you using? On what operating system?

Using bullet 2.77 on Slackware64-13.1

Please provide any additional information below.

Linking libBulletMultiThreaded.so to lpthread seems to solve the issue, but I'm 
not sure whether that's the proper solution.

Original issue reported on code.google.com by ppr...@liwjatan.at on 2 Oct 2010 at 3:37

GoogleCodeExporter commented 9 years ago
It seems that the CMake option USE_MULTITHREADED_BENCHMARK was enabled, but the 
option is disabled by default.

Did you manually enable it?

Indeed, if enabled, it requires pthread to compile.

Original comment by erwin.coumans on 4 Oct 2010 at 6:27

GoogleCodeExporter commented 9 years ago
Also, AppAllBulletDemos shouldn't link against BulletMultiThreaded. We need to 
double check this.

Original comment by erwin.coumans on 4 Oct 2010 at 6:30

GoogleCodeExporter commented 9 years ago

Should be fixed in latest trunk.

See http://code.google.com/p/bullet/source/detail?r=2222
Thanks for the report!

Original comment by erwin.coumans on 4 Oct 2010 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 4 Oct 2010 at 7:09

GoogleCodeExporter commented 9 years ago
I tested r2222 and can confirm the fix.

For the record, I did not explicitely enable USE_MULTITHREADED_BENCHMARK, 
looking at ccmake it seems to be indeed disabled by default.

Original comment by ppr...@liwjatan.at on 4 Oct 2010 at 7:38