I am trying to compile a basic C ++ .mex and .oct using an octave environment. A .mex file is just a mexcpp.cpp file from matlab, which you can get in MATLAB using
edit([matlabroot '/extern/examples/mex/mexcpp.cpp']);
The .oct file is a simple C ++ example found here. (http://www.gnu.org/software/octave/doc/interpreter/Getting-Started-with-Oct_002dFiles.html)
I did a little work forcing the visual studio compiler to configure all environment variables as described in the octave wiki using vcvarsall.bat . Before the compiler environment variables were set, I could issue the mkoctfile -v --mex mexcpp.cpp without any errors, but no files were created.
Instead, I had to specify the environment (I used x86) as follows:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
Now the real problem that I am facing is .mex and .oct for compilation. When I try to compile the file, I get:
cc-msvc -d -c -D_WIN32 -DWIN32 -D__WIN32__ -IC:\Octave-3.6.2\include\octave-3.6.2\octave\.. -IC:\Octave-3.6.2\include\octave-3.6.2\octave -IC:\Octave-3.6.2\include -Ic:/Software/VC10Libs/include -Ic:/Software/VC10Libs/include/freetype2 -Ic:/Software/VC10Libs/include -Ic:/Software/VC10Libs/include -O2 -MD -EHsc -wd4244 -fp:strict -fp:except- -I. mexcpp.cpp -o mexcpp.o cl -nologo -c -D_WIN32 -DWIN32 -D__WIN32__ -IC:\Octave-3.6.2\include\octave-3.6.2\octave\.. -IC:\Octave-3.6.2\include\octave-3.6.2\octave -IC:\Octave-3.6.2\include -Ic:/Software/VC10Libs/include -Ic:/Software/VC10Libs/include/freetype2 -Ic:/Software/VC10Libs/include -Ic:/Software/VC10Libs/include -O2 -MD -EHsc -wd4244-fp:strict -fp:except- -I. mexcpp.cpp -Fomexcpp.o mexcpp.cpp C:\Octave-3.6.2\include\math.h(74) : fatal error C1083: Cannot open include file: 'c:/Program Files/Microsoft Visual Studio 10.0/VC/include/math.h': No such file or directory cc-msvc -d -shared -o mexcpp.mex mexcpp.o -Wl,-export:mexFunction -LC:\Octave-3.6.2\lib\octave\3.6.2 -LC:\Octave-3.6.2\lib -loctinterp -loctave -lcruft link -nologo -DLL -out:mexcpp.mex mexcpp.o -LIBPATH:C:\Octave-3.6.2\lib\octave\3.6.2 -LIBPATH:C:\Octave-3.6.2\lib octinterp.lib octave.lib cruft.lib -export:mex Function dirent.lib msvcmath.lib LINK : fatal error LNK1181: cannot open input file 'mexcpp.o'
My Visual C ++ directory is located in c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC , so I'm not sure why it looks in c:/Program Files/Microsoft Visual Studio 10.0/VC ?
source share