Unable to compile .mex files with Windows 7 SDK
1 回表示 (過去 30 日間)
古いコメントを表示
I am running Matlab 2013b on Windows 7 with the Windows 7 SDK. When I try to compile a .mex file, I get the following error:
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
I have looked on the Matlab Answers site but the one answer of Renish Ramegowda in April 2013 did not change anything.
I have MS Visual Studio Express 2013 installed, along with the x86 and x64 redistributables for MS VC 2008, 2010, 2012, and 2013. Matlab does not detect any other compiler than the Windows 7 SDK compiler using mex -setup (manually overriding and selecting the others leads to error messages.)
Perhaps this has something to do with the .bat and .stp files in 'R2013b/bin/win64/mexopts.' But I don't have enough knowledge to edit these.
kernel32.lib is present in C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib
The answers to the question of Ziv Mhabary in 2012 are also of no help.
This is the output from the 'mex -v -g ...' command:
-> Default options filename found in C:\Users\jwinebar\Application Data\MathWorks\MATLAB\R2013b
----------------------------------------------------------------
-> Options file = C:\Users\jwinebar\Application Data\MathWorks\MATLAB\R2013b\mexopts.bat
MATLAB = C:\Program Files\MATLAB\R2013b
-> 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..\target\supp\capp -I..\target\supp\mtli -I..\target\supp\gl2d -I..\target\supp\errt -Izpipo_matlab_environment\c_src\mdstd -I..\..\pipo -Izpipo_matlab_environment\c_src\mwrap -Izpipo_matlab_environment\m_file\make
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2013b\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\jwinebar\AppData\Local\Temp\mex_h3yoN7\templib.x" /MAP:"zpipo_matlab_environment\bin\mpipo.mexw64.map"
LINKDEBUGFLAGS = /debug /PDB:"zpipo_matlab_environment\bin\mpipo.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"zpipo_matlab_environment\bin\mpipo.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "zpipo_matlab_environment\bin\mexversion.res"
-> Resource Linker =
----------------------------------------------------------------
0 件のコメント
回答 (1 件)
Varun Bhaskar
2015 年 8 月 27 日
Hi,
The error is most likely due to a corrupt kernel32.dll file.
Reinstalling Windows SDK 7.1 should resolve the issue. Please refer to the following installation instructions:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!