yprime.c to mex compile, error using mex at 208

4 views (last 30 days)
Hi all
I'm using Matlab 2011a 64 bit and Microsoft Visual Studio 2010 as a compiler. If I try to compile yprime to a mex file i get following error:
mex -v C:\test\yprime.c
-> Default options filename found in C:\Users\Edgar\AppData\Roaming\MathWorks\MATLAB\R2011a
----------------------------------------------------------------
-> Options file = C:\Users\Edgar\AppData\Roaming\MathWorks\MATLAB\R2011a\mexopts.bat
MATLAB = C:\MATLAB
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = /c /Zp8 /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:\MATLAB\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\Edgar\AppData\Local\Temp\mex_M9xTVg\templib.x" /MAP:"yprime.mexw64.map"
LINKDEBUGFLAGS = /debug /PDB:"yprime.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"yprime.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\yprime.obj -IC:\MATLAB\extern\include -IC:\MATLAB\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 C:\test\yprime.c
yprime.c
C:\test\yprime.c(85) : warning C4267: '=': Konvertierung von 'size_t' nach 'mwSize', Datenverlust m”glich
C:\test\yprime.c(86) : warning C4267: '=': Konvertierung von 'size_t' nach 'mwSize', Datenverlust m”glich
Contents of C:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\mex_tmp.rsp:
C:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\yprime.obj
--> link /out:"yprime.mexw64" /dll /export:mexFunction /LIBPATH:"C:\MATLAB\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\Edgar\AppData\Local\Temp\mex_M9xTVg\templib.x" /MAP:"yprime.mexw64.map" @C:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\mex_tmp.rsp
Bibliothek "C:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\templib.x" und Objekt "C:\Users\Edgar\AppData\Local\Temp\mex_M9xTVg\templib.exp" werden erstellt.
C:\MATLAB\BIN\MEX.PL: Error: Link of 'yprime.mexw64' failed.
??? Error using ==> mex at 208
Unable to complete successfully.
Can please anyone advise?
Thank you! Edgar
  1 Comment
Kaustubha Govind
Kaustubha Govind on 7 Oct 2011
Could you try running MATLAB as administrator and try again (if you're on Windows 7)? Also, try first going into C:\test and then compiling using "mex yprime.c".

Sign in to comment.

Answers (2)

emath
emath on 8 Oct 2011
Thank you for your help, this was actually the problem. Yeah the error message is really not indicating that this is the problem. Have a nice weekend!
Edgar

Jan
Jan on 8 Oct 2011
I assume Kaustubha's 2nd idea "cd('C:\test')" could solve the problem, if you do not have write permissions to the current folder. But the error message is not really helpful.

Categories

Find more on Troubleshooting in MATLAB Compiler SDK 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!