Question

I am trying to get the code from this article up and running, however, I am running into my arch nemesis' LNK2019 and LNK2001. Here is a direct link to download the project zip file. Before anyone asks I have read the unresolved external symbol question. It helped me figure out a few things but I still can't figure out this problem.

The problem has to do with linking to the TBB library. The project code seems to have been written sometime in 2009 when TBB was in version 2.X. The latest stable release (the one I am trying to use) is 4.2. I can't find the version that was used for the project to test with so I can't confirm that way. I would also prefer to use the most up-to-date version of the library.

Can anyone help me determine if these linker errors are due to an api mismatch between the project code and TBB, or am I just not setting up my environment variables / property pages correctly? I am using MSVS2010 Express.

Here are the errors:

1>------ Build started: Project: VorteGrid, Configuration: Debug Win32 ------
1>inteSiVis.obj : error LNK2019: unresolved external symbol "public: void __thiscall tbb::task_scheduler_init::initialize(int,unsigned int)" (?initialize@task_scheduler_init@tbb@@QAEXHI@Z) referenced in function "public: __thiscall tbb::task_scheduler_init::task_scheduler_init(int,unsigned int)" (??0task_scheduler_init@tbb@@QAE@HI@Z)
1>inteSiVis.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::task_scheduler_init::task_scheduler_init(int,unsigned int)" (??0task_scheduler_init@tbb@@QAE@HI@Z)
1>vortonSim.obj : error LNK2001: unresolved external symbol "void __cdecl tbb::assertion_failure(char const *,int,char const *,char const *)" (?assertion_failure@tbb@@YAXPBDH00@Z)
1>particleRenderer.obj : error LNK2001: unresolved external symbol "void __cdecl tbb::assertion_failure(char const *,int,char const *,char const *)" (?assertion_failure@tbb@@YAXPBDH00@Z)
1>inteSiVis.obj : error LNK2019: unresolved external symbol "public: void __thiscall tbb::task_scheduler_init::terminate(void)" (?terminate@task_scheduler_init@tbb@@QAEXXZ) referenced in function "public: __thiscall tbb::task_scheduler_init::~task_scheduler_init(void)" (??1task_scheduler_init@tbb@@QAE@XZ)
1>vortonSim.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::interface6::internal::start_for<class tbb::blocked_range<unsigned int>,class VortonSim_ComputeVelocityGrid_TBB,class tbb::auto_partitioner const >::run(class tbb::blocked_range<unsigned int> const &,class VortonSim_ComputeVelocityGrid_TBB const &,class tbb::auto_partitioner const &)" (?run@?$start_for@V?$blocked_range@I@tbb@@VVortonSim_ComputeVelocityGrid_TBB@@$$CBVauto_partitioner@2@@internal@interface6@tbb@@SAXABV?$blocked_range@I@4@ABVVortonSim_ComputeVelocityGrid_TBB@@ABVauto_partitioner@4@@Z)
1>particleRenderer.obj : error LNK2001: unresolved external symbol "public: __thiscall tbb::task_group_context::~task_group_context(void)" (??1task_group_context@tbb@@QAE@XZ)
1>vortonSim.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>particleRenderer.obj : error LNK2001: unresolved external symbol "protected: void __thiscall tbb::task_group_context::init(void)" (?init@task_group_context@tbb@@IAEXXZ)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>vortonSim.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall tbb::task::note_affinity(unsigned short)" (?note_affinity@task@tbb@@UAEXG@Z)
1>particleRenderer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall tbb::task::note_affinity(unsigned short)" (?note_affinity@task@tbb@@UAEXG@Z)
1>vortonSim.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::interface6::internal::auto_partition_type_base<class tbb::interface6::internal::auto_partition_type>::auto_partition_type_base<class tbb::interface6::internal::auto_partition_type>(void)" (??0?$auto_partition_type_base@Vauto_partition_type@internal@interface6@tbb@@@internal@interface6@tbb@@QAE@XZ)
1>particleRenderer.obj : error LNK2001: unresolved external symbol "unsigned int __cdecl tbb::internal::get_initial_auto_partitioner_divisor(void)" (?get_initial_auto_partitioner_divisor@internal@tbb@@YAIXZ)
1>vortonSim.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>particleRenderer.obj : error LNK2001: unresolved external symbol "private: void __thiscall tbb::task::internal_set_ref_count(int)" (?internal_set_ref_count@task@tbb@@AAEXH@Z)
1>vortonSim.obj : error LNK2019: unresolved external symbol "public: bool __thiscall tbb::task_group_context::is_group_execution_cancelled(void)const " (?is_group_execution_cancelled@task_group_context@tbb@@QBE_NXZ) referenced in function "public: bool __thiscall tbb::task::is_cancelled(void)const " (?is_cancelled@task@tbb@@QBE_NXZ)
1>particleRenderer.obj : error LNK2001: unresolved external symbol "public: bool __thiscall tbb::task_group_context::is_group_execution_cancelled(void)const " (?is_group_execution_cancelled@task_group_context@tbb@@QBE_NXZ)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>vortonSim.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>particleRenderer.obj : error LNK2001: 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)
1>VorteGrid\Debug\VorteGrid.exe : fatal error LNK1120: 15 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

UPDATE

I managed to get the CFD code up and running! Yay :) The problem is that I am on a 64 bit machine but I was using the 32-bit version of MSVS2010 express. I didn't realize this and I was trying to use the intel64 libs (i.e. ...\tbb\lib\intel64\vc10). Somehow this issue manifested in linker errors which doesn't really make sense. Anyway, switching to ia32 cleared up that problem, and the project would build.

The next hurdle was the application complaining about some non-descriptive error like "There was an error with the program ([registry code])." So I ended up trying to run the TBB examples. The examples gave clearer errors when run, saying "The tbb.dll file is missing from your computer. Try reinstalling the program". After some more googling, I found an easy solution: move the dll files it was complaining about into the application directory.

Then, at long last, the application worked. The visual effect is so worth it. I can't wait to start playing around with this.

Was it helpful?

Solution

These errors are caused by some environment/configuration issues.

Generally, newer TBB versions are compatible (both on the source and binary level) with older ones. The particular symbols mentioned in the shown errors are for the core TBB functionality; they did not change for a while, and surely exist in the version 4.2 binaries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top