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

Linking with /clr switch

mwhenson
Beginner
393 Views
When I try to build with a /clr switch, I get the following errors if tbb_exception.h is included. If /clr switch is off or i remove the tbb_exception.h include, it builds fine. Any ideas on what is going on or how to fix it? Thanks!

22> error LNK2028: unresolved token (0A002130) "private: void __thiscall tbb::captured_exception::clear(void)" (?clear@captured_exception@tbb@@$FAAEXXZ) referenced in function "public: virtual __thiscall tbb::captured_exception::~captured_exception(void)" (??1captured_exception@tbb@@$FUAE@XZ)
22>obj : error LNK2028: unresolved token (0A002131) "private: void __thiscall tbb::captured_exception::set(char const *,char const *)" (?set@captured_exception@tbb@@$FAAEXPBD0@Z) referenced in function "public: __thiscall tbb::captured_exception::captured_exception(class tbb::captured_exception const &)" (??0captured_exception@tbb@@$FQAE@ABV01@@Z)
22>obj : error LNK2019: unresolved external symbol "private: void __thiscall tbb::captured_exception::set(char const *,char const *)" (?set@captured_exception@tbb@@$FAAEXPBD0@Z) referenced in function "public: __thiscall tbb::captured_exception::captured_exception(class tbb::captured_exception const &)" (??0captured_exception@tbb@@$FQAE@ABV01@@Z)
22>obj : error LNK2001: unresolved external symbol "public: virtual class tbb::captured_exception * __thiscall tbb::captured_exception::move(void)" (?move@captured_exception@tbb@@UAEPAV12@XZ)
22>obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall tbb::captured_exception::destroy(void)" (?destroy@captured_exception@tbb@@UAEXXZ)
22>obj : error LNK2019: unresolved external symbol "private: void __thiscall tbb::captured_exception::clear(void)" (?clear@captured_exception@tbb@@$FAAEXXZ) referenced in function "public: virtual __thiscall tbb::captured_exception::~captured_exception(void)" (??1captured_exception@tbb@@$FUAE@XZ)
0 Kudos
6 Replies
mwhenson
Beginner
393 Views
Also - this is new to 2.2 and built fine in 2.1.

Mike
0 Kudos
Andrey_Marochko
New Contributor III
393 Views
At the first glance the issue may be caused by the missing __TBB_EXPORTED_METHOD qualifier before the offending symbols. Could you insert them (similar to how it is done for name() and what() methods) and see if this helps?

0 Kudos
mwhenson
Beginner
393 Views
At the first glance the issue may be caused by the missing __TBB_EXPORTED_METHOD qualifier before the offending symbols. Could you insert them (similar to how it is done for name() and what() methods) and see if this helps?

Unfortunately that didn't work... Do you have any other suggestions? Thanks,

Mike
0 Kudos
Andrey_Marochko
New Contributor III
393 Views
Hi, Mike

Sorry to say that, but after checking .def files I see that unfortunately TBB simply does not export these methods :(. And you are obviously the first one who needed them.

We'll fix this in the Update 1 to 2.2. If you use open source version, I could give you instructions how to export the missing methods.
0 Kudos
mwhenson
Beginner
393 Views
Hi, Mike

Sorry to say that, but after checking .def files I see that unfortunately TBB simply does not export these methods :(. And you are obviously the first one who needed them.

We'll fix this in the Update 1 to 2.2. If you use open source version, I could give you instructions how to export the missing methods.
I don't actually use them, but it appears that the /clr switch forces the compiler to link whether they are used or not. Commenting out all these methods from the .h file will do until the Update 1. Thanks,

Mike
0 Kudos
Andrey_Marochko
New Contributor III
393 Views
Quoting - mwhenson
I don't actually use them, but it appears that the /clr switch forces the compiler to link whether they are used or not. Commenting out all these methods from the .h file will do until the Update 1. Thanks,

Mike

Thanks to you for reporting the problem.
0 Kudos
Reply