Problem compiling mex files
4 views (last 30 days)
Show older comments
Hi I am having trouble compiling mex files on Windows computers. The two packages I have tried are : http://www.mathworks.com/matlabcentral/fileexchange/21451-multimodality-non-rigid-demon-algorithm-image-registration and http://www.mathworks.com/matlabcentral/fileexchange/20057-b-spline-grid--image-and-point-based-registration using the compile c code m files
The error I get is the following
compiling : ._bspline_error_2d_double.c -> Default options filename found in C:\Users\Orger\AppData\Roaming\MathWorks\MATLAB\R2012a ---------------------------------------------------------------- -> Options file = C:\Users\Orger\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat MATLAB = C:\Program Files\MATLAB\R2012a -> COMPILER = cl -> Compiler flags: COMPFLAGS = /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD OPTIMFLAGS = /O2 /Oy- /DNDEBUG DEBUGFLAGS = /Z7 arguments = Name switch = /Fo -> Pre-linking commands = -> LINKER = link -> Link directives: LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2012a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\Users\Orger\AppData\Local\Temp\mex_1feKKo\templib.x" /MAP:"_bspline_error_2d_double.mexw64.map" LINKDEBUGFLAGS = /debug /PDB:"_bspline_error_2d_double.mexw64.pdb" LINKFLAGSPOST = Name directive = /out:"_bspline_error_2d_double.mexw64" File link directive = Lib. link directive = Rsp file indicator = @ -> Resource Compiler = rc /fo "mexversion.res" -> Resource Linker = ----------------------------------------------------------------
--> cl /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\Orger\AppData\Local\Temp\mex_1feKKo\.obj -I"C:\Program Files\MATLAB\R2012a\extern\include" /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 ._bspline_error_2d_double.c
._bspline_error_2d_double.c ._bspline_error_2d_double.c : warning C4821: Unable to determine Unicode encoding type, please save the file with signature (BOM) ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x5' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x16' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x7' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x2' ._bspline_error_2d_double.c(1) : error C2061: syntax error : identifier 'OS' ._bspline_error_2d_double.c(1) : error C2059: syntax error : ';' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x2' ._bspline_error_2d_double.c(1) : error C2143: syntax error : missing '{' before 'constant' ._bspline_error_2d_double.c(1) : error C2059: syntax error : '<Unknown>' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0xe' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x2' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0xe' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1e' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0xe' ._bspline_error_2d_double.c(1) : error C2061: syntax error : identifier 'É~9' ._bspline_error_2d_double.c(1) : error C2059: syntax error : ';' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x15' ._bspline_error_2d_double.c(1) : error C2061: syntax error : identifier 'com' ._bspline_error_2d_double.c(1) : error C2059: syntax error : ';' ._bspline_error_2d_double.c(1) : error C2059: syntax error : '.' ._bspline_error_2d_double.c(1) : error C2021: expected exponent value, not 'b' ._bspline_error_2d_double.c(1) : error C2059: syntax error : 'bad suffix on number' ._bspline_error_2d_double.c(1) : error C2059: syntax error : 'constant' ._bspline_error_2d_double.c(1) : error C2143: syntax error : missing '{' before '-' ._bspline_error_2d_double.c(1) : error C2059: syntax error : '-' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1e' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1e' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1c' ._bspline_error_2d_double.c(1) : error C2018: unknown character '0x1e'
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Compile of '._bspline_error_2d_double.c' failed.
I have tried using Matlab R2012A with Microsoft SDK as the compiler, and I also tried on another computer R2010A using Visual C++ 2010 Express and got the same error. I also tried adding a BOM to the file bspline_error_2d_double.c which didn't seem to fix the problem (maybe it is another file that needs a BOM?).
Thank you to anyone who can help. This is quite frustrating, and I have not been able to find anyone with a similar problem by googling.
3 Comments
Geoff Hayes
on 21 Aug 2014
Saw from your answer below that you figured out the problem - great! The lcc option was available when I ran mex-setup (I didn't have to manually add it).
Accepted Answer
More Answers (0)
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!