Error to compile Mex

2 views (last 30 days)
FAISAL
FAISAL on 17 Jun 2014
Commented: FAISAL on 19 Jun 2014
Hi, i wanted to use one of the program for denoising, which i need to use the mex. But, when i tried to set up the Mex, i have a problem to compile which it gave me error as below:
Error using mex (line 206) Unable to complete successfully.
Error in compile (line 12) mex -v -largeArrayDims ../mex/mdwt.c ../lib/src/dwt.c ../lib/src/init.c ../lib/src/platform.c -I../lib/inc -outdir ../bin
I am using the Microsoft Windows Software Development Kit 7.1 and matlab R2012b. To setup this, i first put a command " mex -setup " and it asked me to choose the compiler which i choose the Microsoft Windows Software Development Kit 7.1, and it basically run well, but the problem occured wehn i need to compile the files of the program. Attached is the program if you need to look at the program.
Thanks in advance for your help! really appreciate it
  2 Comments
James Tursa
James Tursa on 18 Jun 2014
What is the detailed error message? (i.e., the error message you see prior to the "Unable to complete successfully" message)
FAISAL
FAISAL on 19 Jun 2014
Hi James,
Below is the detail error message, and basically i read one of this discussion in Matlab support, it says i have to include matrix or include mex, i tried to put either one at first, then both of them, but it still didnt work. REally appreciate if you could help this! Thanks!
>> compile -> Default options filename found in C:\Users\mmm112\AppData\Roaming\MathWorks\MATLAB\R2012b ---------------------------------------------------------------- -> Options file = C:\Users\mmm112\AppData\Roaming\MathWorks\MATLAB\R2012b\mexopts.bat MATLAB = C:\Program Files\MATLAB\R2012b -> 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 = -I../lib/inc Name switch = /Fo -> Pre-linking commands = -> LINKER = link -> Link directives: LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2012b\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\mmm112\AppData\Local\Temp\mex_VB_bPg\templib.x" /MAP:"../bin\mdwt.mexw64.map" LINKDEBUGFLAGS = /debug /PDB:"../bin\mdwt.mexw64.pdb" LINKFLAGSPOST = Name directive = /out:"../bin\mdwt.mexw64" File link directive = Lib. link directive = Rsp file indicator = @ -> Resource Compiler = rc /fo "../bin\mexversion.res" -> Resource Linker = ----------------------------------------------------------------
--> cl -I../lib/inc /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\mmm112\AppData\Local\Temp\mex_VB_bPg\mdwt.obj -I"C:\Program Files\MATLAB\R2012b\extern\include" -I"C:\Program Files\MATLAB\R2012b\simulink\include" /O2 /Oy- /DNDEBUG ..\mex\mdwt.c
mdwt.c d:\phd research\004 programming & design\001 matlab\004 image processing\rwt-master\rwt-master\lib\inc\rwt_platform.h(44) : warning C4005: 'max' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(854) : see previous definition of 'max' d:\phd research\004 programming & design\001 matlab\004 image processing\rwt-master\rwt-master\lib\inc\rwt_platform.h(45) : warning C4005: 'min' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(855) : see previous definition of 'min'
--> cl -I../lib/inc /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\mmm112\AppData\Local\Temp\mex_VB_bPg\dwt.obj -I"C:\Program Files\MATLAB\R2012b\extern\include" -I"C:\Program Files\MATLAB\R2012b\simulink\include" /O2 /Oy- /DNDEBUG ..\lib\src\dwt.c
dwt.c ../lib/inc\rwt_platform.h(44) : warning C4005: 'max' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(854) : see previous definition of 'max' ../lib/inc\rwt_platform.h(45) : warning C4005: 'min' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(855) : see previous definition of 'min'
--> cl -I../lib/inc /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\mmm112\AppData\Local\Temp\mex_VB_bPg\init.obj -I"C:\Program Files\MATLAB\R2012b\extern\include" -I"C:\Program Files\MATLAB\R2012b\simulink\include" /O2 /Oy- /DNDEBUG ..\lib\src\init.c
init.c d:\phd research\004 programming & design\001 matlab\004 image processing\rwt-master\rwt-master\lib\inc\rwt_platform.h(44) : warning C4005: 'max' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(854) : see previous definition of 'max' d:\phd research\004 programming & design\001 matlab\004 image processing\rwt-master\rwt-master\lib\inc\rwt_platform.h(45) : warning C4005: 'min' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdlib.h(855) : see previous definition of 'min' ..\lib\src\init.c(97) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data ..\lib\src\init.c(171) : error C2143: syntax error : missing ';' before 'type' ..\lib\src\init.c(172) : error C2065: 'argNumL' : undeclared identifier ..\lib\src\init.c(173) : error C2065: 'argNumL' : undeclared identifier ..\lib\src\init.c(187) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data ..\lib\src\init.c(195) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
C:\PROGRA~1\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of '..\lib\src\init.c' failed.
Error using mex (line 206) Unable to complete successfully.
Error in compile (line 13) mex -v -largeArrayDims ../mex/mdwt.c ../lib/src/dwt.c ../lib/src/init.c ../lib/src/platform.c -I../lib/inc -outdir ../bin

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!