MATLAB: Compiler cannot find “tmwtypes.h”

cdeploymentgccMATLAB Compilershared library

[EDIT: Thu May 12 22:23:56 UTC 2011 Duplicate Removed – MKF]
I tried to deploy a MATLAB shared library on a Linux computer. When I compiled my C code on the linux computer, I got this strange error.
/opt/MATLAB/MATLAB_Compiler_Runtime/v714/extern/include/matrix.h(293): catastrophic error: could not open source file "tmwtypes.h" #include tmwtypes.h ^
maxtrix.h and tmwtypes.h are in the same folder. I am using x86-64 with suse linux
Does anyone know what the problem this is?
Thanks.

Best Answer

Note that matrix.h has the following include line:
#include <tmwtypes.h>
So that is with <> brackets and not "" double quotes, or in other words the compiler will look for the file in your include directories and not in the same/current directory. To resolve this add the extern/include directory to your include path, for example by using the -I (capital i) switch in your call to gcc/g++.