Matlab and c style dll

I have a very nasty problem with Matlab. I have a regular C-style DLL to talk to our hardware. It works great on my PC and works great on my colleague's computer. On the third PC, it does not boot using:

Error using ==> loadlibrary on 365 Failed to complete preliminary input file input process. Exiting the preprocessor: "cl" is not recognized as an internal or external command, operating program, or batch file.

Obviously, he cannot find the compiler. However, the launch! Mex -setup gets my intermediate bit to select the only compiler on the machine (VS2008) and check with! Set vs shows the paths as correct. Trying to add paths directly also does not help. Since I know very little about Matlab and the extensive trawl on the Matlab forums and attempted suggestions it just doesn't help. Someone tell me?

+4
source share
2 answers

I do not when you added the path directly, but try adding the path where cl.exe is located in:

My computer → Properties → Advanced → Environment variables → System variables → PATH

If you open a command prompt (Execute → cmd.exe) and write "set PATH" (without "), can you find the correct path? What happens if you write cl.exe. Perhaps you need to run vcvars32. Bat from the right Visual Studio versions (e.g. C: \ Program Files (x86) \ Microsoft Visual Studio 9.0 \ VC \ bin)

+5
source

Perhaps hacked as creating a cl.bat / cl.cmd file, for example

@rem CL.CMD @rem vcvars32 or vcvars64 depending on the OS @rem Explicitly set the variables for VC call "<YourVCDir>\Bin\VCVARS32.BAT" @rem Pass all the parameters to the "real" cl.exe cl.exe %* 

will help?

+3
source

All Articles