Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab and C style dll

Tags:

c++

dll

matlab

I have a very annoying problem with Matlab. I have a custom C style DLL to talk to our hardware. It works fine on my PC and fine on my colleague's PC. On a third PC it fails to load with :

Error using ==> loadlibrary at 365 Failed to preprocess the input file. Output from preprocessor is:'cl' is not recognized as an internal or external command, operable program or batch file.

Obviously it can't find the compiler. Yet running !mex -setup gets my the intercative bit to select the only compiler on the machine (VS2008) and checking with !set vs shows the paths as correct. Trying to add paths directly doesn't seem to help either. As I very little idea about Matlab and an extensive trawl of the matlab forums and trying suggestions just doesn't help. Anybody any clues?

like image 962
ExpatEgghead Avatar asked Feb 20 '23 20:02

ExpatEgghead


1 Answers

I don't do where you added the path directly, but try to add the path where cl.exe is into the:

My Computer -> Properties -> Advanced -> Environment Variables -> System Variables -> PATH

If you open a command prompt (Execute -> cmd.exe) and write "set PATH" (without the ") can you find the right path? What happens if you write cl.exe. Maybe you should execute vcvars32.bat from the right Visual Studio version (i.e. C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin )

like image 57
alcor Avatar answered Feb 28 '23 09:02

alcor