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

Linker Errors on sub_string_finder_cl example on 64bit machine.

codecalibre
Beginner
430 Views
Windows 7 Ultimate
Visual Studio 2008 Team System x64
TBB30_104oss (installed using intel64 and vs2008/vc9)

I am just starting to use TBB and just following Getting Started document. After copying tbb.dll and tbb_debug.dll from the bin (intel64 vc9 version of course) to the project folder, and modifying lib paths of the project from ia32 to intel64... i get linker errors seen below. How do I fix it?

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "void __cdecl tbb::assertion_failure(char const *,int,char const *,char const *)" (?assertion_failure@tbb@@YAXPBDH00@Z) referenced in function "public: __thiscall tbb::blocked_range::blocked_range(unsigned int,unsigned int,unsigned int)" (??0?$blocked_range@I@tbb@@QAE@III@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: __thiscall tbb::task_group_context::~task_group_context(void)" (??1task_group_context@tbb@@QAE@XZ) referenced in function "public: static void __cdecl tbb::internal::start_for,class SubStringFinder,class tbb::auto_partitioner>::run(class tbb::blocked_range const &,class SubStringFinder const &,class tbb::auto_partitioner const &)" (?run@?$start_for@V?$blocked_range@I@tbb@@VSubStringFinder@@Vauto_partitioner@2@@internal@tbb@@SAXABV?$blocked_range@I@3@ABVSubStringFinder@@ABVauto_partitioner@3@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "protected: void __thiscall tbb::task_group_context::init(void)" (?init@task_group_context@tbb@@IAEXXZ) referenced in function "public: __thiscall tbb::task_group_context::task_group_context(enum tbb::task_group_context::kind_type,unsigned int)" (??0task_group_context@tbb@@QAE@W4kind_type@01@I@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: class tbb::task & __thiscall tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int)const " (?allocate@allocate_root_with_context_proxy@internal@tbb@@QBEAAVtask@3@I@Z) referenced in function "void * __cdecl operator new(unsigned int,class tbb::internal::allocate_root_with_context_proxy const &)" (??2@YAPAXIABVallocate_root_with_context_proxy@internal@tbb@@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: void __thiscall tbb::internal::allocate_root_with_context_proxy::free(class tbb::task &)const " (?free@allocate_root_with_context_proxy@internal@tbb@@QBEXAAVtask@3@@Z) referenced in function "void __cdecl operator delete(void *,class tbb::internal::allocate_root_with_context_proxy const &)" (??3@YAXPAXABVallocate_root_with_context_proxy@internal@tbb@@@Z)

1>sub_string_finder.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall tbb::task::note_affinity(unsigned short)" (?note_affinity@task@tbb@@UAEXG@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl tbb::internal::get_initial_auto_partitioner_divisor(void)" (?get_initial_auto_partitioner_divisor@internal@tbb@@YAIXZ) referenced in function "public: __thiscall tbb::auto_partitioner::partition_type::partition_type(class tbb::auto_partitioner const &)" (??0partition_type@auto_partitioner@tbb@@QAE@ABV12@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "private: void __thiscall tbb::task::internal_set_ref_count(int)" (?internal_set_ref_count@task@tbb@@AAEXH@Z) referenced in function "public: void __thiscall tbb::task::set_ref_count(int)" (?set_ref_count@task@tbb@@QAEXH@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: class tbb::task & __thiscall tbb::internal::allocate_continuation_proxy::allocate(unsigned int)const " (?allocate@allocate_continuation_proxy@internal@tbb@@QBEAAVtask@3@I@Z) referenced in function "void * __cdecl operator new(unsigned int,class tbb::internal::allocate_continuation_proxy const &)" (??2@YAPAXIABVallocate_continuation_proxy@internal@tbb@@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: void __thiscall tbb::internal::allocate_continuation_proxy::free(class tbb::task &)const " (?free@allocate_continuation_proxy@internal@tbb@@QBEXAAVtask@3@@Z) referenced in function "void __cdecl operator delete(void *,class tbb::internal::allocate_continuation_proxy const &)" (??3@YAXPAXABVallocate_continuation_proxy@internal@tbb@@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: class tbb::task & __thiscall tbb::internal::allocate_child_proxy::allocate(unsigned int)const " (?allocate@allocate_child_proxy@internal@tbb@@QBEAAVtask@3@I@Z) referenced in function "void * __cdecl operator new(unsigned int,class tbb::internal::allocate_child_proxy const &)" (??2@YAPAXIABVallocate_child_proxy@internal@tbb@@@Z)

1>sub_string_finder.obj : error LNK2019: unresolved external symbol "public: void __thiscall tbb::internal::allocate_child_proxy::free(class tbb::task &)const " (?free@allocate_child_proxy@internal@tbb@@QBEXAAVtask@3@@Z) referenced in function "void __cdecl operator delete(void *,class tbb::internal::allocate_child_proxy const &)" (??3@YAXPAXABVallocate_child_proxy@internal@tbb@@@Z)

1>C:\\Users\\ANDREI~1\\AppData\\Local\\Temp\\tbb_examples\\Debug\\sub_string_finder.exe : fatal error LNK1120: 12 unresolved externals

0 Kudos
6 Replies
robert-reed
Valued Contributor II
430 Views
Well, it certainly looks like you're getting a failure to link. You copied the TBB DLLs from their installed location to the project folder ... why? (Rather than telling the linker where in the file system the library(ies) installed?) I'd leave the TBB shared libraries where they were and play with the VS project to verify the library paths are correct. If you had gotten a copy of Intel Parallel Composer along with TBB, there's a handy little control in its property pages that automatically can set up the linkage to TBB,but without that there can be a bit more hair involved to tie the installed library to the project.

Also, if you go to the threadingbuildingblocks.org website and drill down into Downloads/Extras, you'll find a set of MSVS plug-ins that can be used to set up the configuration for various versions of TBB.
0 Kudos
Vladimir_P_1234567890
430 Views
it look like wrong/old lib file was taken, could you check the environment?
--Vladimir
0 Kudos
codecalibre
Beginner
430 Views
Well if I simply switch the lib path from intel64 back to ia32 again, there are no linker errors and it compiled fine. But of course, that would have problems on run-time since I intend to use the 64 bit version. Something is wrong/incomplete with the default supplied .lib for intel64 version perhaps?

Also, I just followed Getting Started. I was instructed there to just point the include and lib on the project settings not on the IDE (I don't intent to add it either because using this version for this project only). In my experience doing this would require me to put in the correct .dll of the .libs used to where the compiled binaries will look for it. In this case, it's the same directory as the exe.

-- in short, ia32 works fine but not intel64 --
0 Kudos
Vladimir_P_1234567890
430 Views
Do you use "Debug/x64" config to build the example? i'm not sure why it is needed to change lib directories manually. it should work from the box.
--Vladimir
0 Kudos
codecalibre
Beginner
430 Views
Oh stupid me.
Didn't notice that. However, switching the platform to x64, my VS2008 complains that it cannot view the properties. Showing an error:
The operation could not be completed. Unspecified error.
And doing a Clean/Build/Rebuild Project would just silently show on the output:
====== Rebuild All: 0 succeeded, 0 failed, 1 skipped =======
0 Kudos
robert-reed
Valued Contributor II
430 Views
Another sanity check: you did install the Microsoft KBs for upgrading VS 2008 (which is a 32-bit application) to support 64-bit cross-compiling? I'm guessing "yes" because you did report seeing an x64 build configuration, but the rest leads me to wonder whether that was completely successful.
0 Kudos
Reply