Download

Linking errors when using thirdparty TBB with Unreal 4.26

Hello,
I am using Unreal Version: 4.26.2 on Window 10 and would like to use Intel TBB library (Threading Building Blocks) in an Unreal C++ plugin.

Adding IntelTBB in the module dependency seems to work and Unreal finds the TBB include directory.

    PublicDependencyModuleNames.AddRange(
        new string[]
        {
            "Core",
            "IntelTBB"
        }
        );

Unfortunately, compiling the code, I get linking errors.

error LNK2019: unresolved external symbol “public: void __cdecl tbb::task_scheduler_init::initialize(int,unsigned __int64)” (?initialize@task_scheduler_init@tbb@@QEAAXH_K@Z) referenced in function “public: static void __cdecl Test::MultithreadingTest::run(void)” (?run@MultithreadingTest@Test@@SAXXZ)

how to fix this problem?

I fixed the linking problems by adding those lines in the build file

    //Add Static Libraries
    PublicAdditionalLibraries.Add("tbb.lib");
    PublicAdditionalLibraries.Add("tbbmalloc.lib");