Info

This question is closed. Reopen it to edit or answer.

Failed in compiling the MEX code by Matlab R2009b, R2010b in Visual C++ 2008

2 views (last 30 days)
My setup: Windows 7, Enterprise Matlab 2009Rb or 2010Rb, Visual C++ 2008 1. I used the Microsoft Visual C++ 2008 SP1 compiler and command mcc -W cpplib:libmyadd2 -T link:lib myadd2.m to get my function m file myadd2 to dll for use in C++. 2. Moved 3 files libmyadd2.lib, libmyadd2.h, libmyadd2.dll to VC project folder. 3. Setup the additional include, linking path 4. Passed the build in VC++ 2008, windows console app. 5. Ran into error before getting errors: Entry point Not Found The procedure entry point ?initialize@task_scheduler_init@tbb@@QAEXHI@Z could not be located in the dynamic link library tbb.dll.

Answers (1)

Walter Roberson
Walter Roberson on 26 Jan 2011
It appears that tbb.dll is Intel's Threaded Building Blocks library. It appears that in general tbb::task_scheduler_init is an object class and that a member of it must be constructed for every thread that uses tbb. Some information about tbb and its usage can be found here
As to why that particular procedure could not be found, I don't know. If you are using Intel's binary release of tbb.dll then apparently Intel does not support static linking of tbb and apparently you can get that problem if you attempt to statically link the library. I do not have enough knowledge of mcc to know whether it tries to link the library statically.
If it happens that the problem is static linking of the library (possible but not necessarily plausible) then you can download the open source version of tbb and build it statically, according to this thread on Intel's site.
No promises at all; I'm just pulling together some theoretical information.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!