Multithreaded Linking Problems

Geometrian
Posts: 25
Joined: Sat Dec 03, 2011 8:37 pm

Multithreaded Linking Problems

Post by Geometrian »

Hi,

I have a brand new 6-core (12 thread) custom-built laptop, and I want to make it do multithreading for Physics! I'm having some problems getting it set up, though.

I have gotten simple, single-threaded rigid-body Physics working perfectly with Bullet.

I tried reverse-engineering the MultiThreadeDemo found in Demos/. Unfortunately, I continually get unresolved symbol linker errors when I attempt to go multithreaded. For example, some errors:

Code: Select all

1>Tutorials.obj : error LNK2001: unresolved external symbol "public: __thiscall SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher(class btThreadSupportInterface *,unsigned int,class btCollisionConfiguration *)" (??0SpuGatheringCollisionDispatcher@@QAE@PAVbtThreadSupportInterface@@IPAVbtCollisionConfiguration@@@Z)
1>Tutorials.obj : error LNK2001: unresolved external symbol "public: __thiscall Win32ThreadSupport::Win32ThreadSupport(struct Win32ThreadSupport::Win32ThreadConstructionInfo const &)" (??0Win32ThreadSupport@@QAE@ABUWin32ThreadConstructionInfo@0@@Z)
1>Tutorials.obj : error LNK2001: unresolved external symbol "void __cdecl processCollisionTask(void *,void *)" (?processCollisionTask@@YAXPAX0@Z)
1>Tutorials.obj : error LNK2001: unresolved external symbol "void * __cdecl createCollisionLocalStoreMemory(void)" (?createCollisionLocalStoreMemory@@YAPAXXZ)
Help? Thanks,
Ian
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: Multithreaded Linking Problems

Post by Yann »

You sure you linked with the right library ? (BulletMultiThreaded, as far as I remember)
Geometrian
Posts: 25
Joined: Sat Dec 03, 2011 8:37 pm

Re: Multithreaded Linking Problems

Post by Geometrian »

Hmmm, I'm not.

I am not seeing such a library existing in Bullet. I see src/BulletMultiThreaded, but none of the projects create it?

Ian
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: Multithreaded Linking Problems

Post by Yann »

It's built by the BulletMultiThreaded project.
It was just not installed in previous versions of bullet, use the last revision of Bullet and you'll have it (or copy it it manually).
Geometrian
Posts: 25
Joined: Sat Dec 03, 2011 8:37 pm

Re: Multithreaded Linking Problems

Post by Geometrian »

Yann wrote:It's built by the BulletMultiThreaded project.
It was just not installed in previous versions of bullet, use the last revision of Bullet and you'll have it (or copy it it manually).
It does not seem to present in either 2.80rev2531 or 2.80rev2533

Thanks,
Ian
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: Multithreaded Linking Problems

Post by Yann »

Geometrian
Posts: 25
Joined: Sat Dec 03, 2011 8:37 pm

Re: Multithreaded Linking Problems

Post by Geometrian »

Yes. As mentioned, I see the existence of src/BulletMultiThreaded. I also see a cmake file. However, I do not see .vcproj(x) files for Visual Studio as I do for the other projects. Is there some reason for this (e.g., threading is not implemented on Windows)--or can I just make a project file in the obvious way?
User avatar
Yann
Posts: 52
Joined: Wed Sep 28, 2011 8:36 am
Location: France

Re: Multithreaded Linking Problems

Post by Yann »

When you build the project using the main CMake file, you have to check the 'BUILD_EXTRAS' options, and the project will be built.
If you want it to be installed too, then check the 'INSTALL_EXTRA_LIBS' option as well.