How can I resolve a segmentation fault caused by a MATLB Engine API tbb.dll version mismatch?

Illustration
smith - 2024-01-10T11:09:36+00:00
Question: How can I resolve a segmentation fault caused by a MATLB Engine API tbb.dll version mismatch?

I am developing a C++  application, which connects and interfaces with MATLAB via the C++ Engine API. When calling "findMATLAB()" in the C++ code, a segmentation fault occurs.   Thread 1 received signal SIGSEGV, Segmentation fault.0x0000000000000000 in ?? ()(gdb) I suspect that this may be due to a mismatch between my compiled version of "tbb.dll" and the MATLAB version. Can this be the cause of the crash?  

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

The "tbb.dll" library is a threading library developed by Intel and shipped with MATLAB. A mismatch between the version of the "tbb.dll" library in your application and the one shipped with MATLAB could cause a segmentation fault.
 
When developing C++ applications that interface with MATLAB Engine and require functions from this library, it is recommended to use the version of "tbb.dll" that ships with MATLAB to avoid this library conflict.
 
To invoke the MATLAB version of "tbb.dll" during runtime, you will need to hide other versions of "tbb.dll", so only the MATLAB version is visible to the C++ application. Since the header files of "tbb.dll" are not shipped with MATLAB, you will need to get the corresponding header files from Intel for compilation. Be sure to download the relevant header files from Intel that correspond to the MATLAB version of "tbb.dll". Version information for "tbb.dll" can be found by the following command in Windows PowerShell:
 
 
get-command "" | format-list

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!