Matlab r2013a support for mingw c compiler
![matlab r2013a support for mingw c compiler matlab r2013a support for mingw c compiler](https://www.mathworks.com/responsive_image/100/100/0/0/0/cache/matlabcentral/profiles/7032132_1522119674693_DEF.jpg)
- #MATLAB R2013A SUPPORT FOR MINGW C COMPILER CODE#
- #MATLAB R2013A SUPPORT FOR MINGW C COMPILER WINDOWS#
![matlab r2013a support for mingw c compiler matlab r2013a support for mingw c compiler](https://tktran2014.files.wordpress.com/2014/07/capture.png)
I got this directly from one of the two links above and modified directory & compiler names and added -std=c++11 set MATLAB=%MATLAB% > x86_64-w64-mingw32-g++ -std=c++11 -fexceptions -I"C:\Program Files\MATLAB\R2013a\extern\include" -oC:\Users\Bas\AppData\Local\Temp\mex_r7jRw0\Gomoku_mex.obj -I"C:\Program Files\MATLAB\R2013a\extern\include" -I"C:\Program Files\MATLAB\R2013a\simulink\include" -O3 -fexpensive-optimizations -DNDEBUG -DMX_COMPAT_32 Gomoku_mex.cppĬ:\Users\Bas\AppData\Local\Temp\cc4hwD3A.o:Gomoku_mex.cpp:(.text+0x9d1c): undefined reference to `mxGetPr'Ĭ:\Users\Bas\AppData\Local\Temp\cc4hwD3A.o:Gomoku_mex.cpp:(.text+0x9d83): undefined reference to `mxCreateDoubleScalar'Ĭ:/PROGRA~1/mingw-w64/x86_64-4.9.0-posix-seh-rt_v3-rev2/mingw64/bin/./lib/gcc/x86_64-w64-mingw32/4.9.0/././././x86_64-w64-mingw32/bin/ld.exe: C:\Users\Bas\AppData\Local\Temp\cc4hwD3A.o: bad reloc address 0x0 in section `.pdata$_ZNKSt5ctypeIcE8do_widenEc'Ĭollect2.exe: error: ld returned 1 exit statusĬ:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: Compile of 'Gomoku_mex.cpp' failed.Įdit: As extra information, this is my mexopts.bat file. LINKFLAGSPOST = -lmex -lmx -lmat -lmwlapack -lmwblas LINKFLAGS = -shared mex.def -L"C:\Program Files\MATLAB\R2013a\bin\win64" -static-libstdc++ OPTIMFLAGS = -O3 -fexpensive-optimizations -DNDEBUG > Options file = C:\Users\Bas\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.batĬOMPFLAGS = -std=c++11 -fexceptions -I"C:\Program Files\MATLAB\R2013a\extern\include" > Default options filename found in C:\Users\Bas\AppData\Roaming\MathWorks\MATLAB\R2013a Here's the output and error message that MATLAB gives: >mex -v Gomoku_mex.cpp Does anyone have suggestions what I might be doing wrong?īy the way, I tried using gnumex to setup the compiler, but that didn't work either.
#MATLAB R2013A SUPPORT FOR MINGW C COMPILER CODE#
The code seems to compile successfully, but the linker reports an error. The program I want to compile uses c++11-style threading, so I'm using mingw-w64 version 4.9.0 with posix threads.Īccording to instruction I found here and here, I modified my mexopts.bat file.
#MATLAB R2013A SUPPORT FOR MINGW C COMPILER WINDOWS#
My laptop has x86_64 architecture and runs windows 7. I'm trying to setup Mingw-w64 as the mex compiler in MATLAB 2013a.