Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2464 Discussions

Static library missing when compiling TBB with MinGW on Windows 7

bherd
Beginner
504 Views
Hi,
I would like to use TBB together with a project which is compiled using MinGW on Windows. Therefore I need to compile TBB with MinGW as well. I've downloaded the source package, unpacked it to a separate directory and called
mingw2-make -compiler=gcc -runtime=mingw
The compilation is successful and the DLL files are being placed in the build/windows_ia32_gcc_mingw_debug/release folders. However I can't find any static libraries like tbb.lib or tbb_debug.lib. Just the dynamic libraries were built. But I need the static ones as well, right?
When I'm trying to compile a small sample TBB program using a concurrent_map, I'm getting a bunch of unresolved externals. Therefore I was assuming that I need to link the static libraries (which is also mentioned in the tutorial).
Does anyone have some ideas what I'm doing wrong?
Thank you very much for your help!!
Ben
0 Kudos
3 Replies
Vladimir_P_1234567890
503 Views
Hi Ben,

Don't you need to link directly to tbb.dll in MinGW case? -ltbb should work in this case, shouldn't it? tbb does not need import lib when gcc is used.
--Vladimir
0 Kudos
bherd
Beginner
503 Views
Hi Vladimir,
thanks a lot for your quick response. You're right - it is working well, when I'm directly linking to tbb.dll. That solved my problem (which wasn't a problem, apparently).
However is there any possibility to achieve static linking? I'm just asking out of curiosity because in some cases it might be beneficial not to have a separate dll.
Regards,
Ben
0 Kudos
Vladimir_P_1234567890
503 Views
We do not support static version of tbb. You can find a way how to get it on windows using a search on this forum but I'm not sure if it will work correctly.
--Vladimir
0 Kudos
Reply