matlab coder: Build error: Compilation returned error status code 2.
Mostrar comentarios más antiguos
I want to use the MATLAB coder to transform a m file to a c file . But I always encounter the problem.
Here is the m file
function a = testfun(b,c)
a = b + c;
end
And the error report is : Build error: Compilation returned error status code 2. See the target build log in the report for further details.
Build log is : 13 link /dll /LIBPATH:"D:\SOFTWA~3\MATLAB~1\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:"testfun_mex.x" /MAP:".\testfun_mex.mexw64.map" /NODEFAULTLIB:LIBCMT /OUT:testfun_mex.mexw64 testfun_initialize.obj testfun_terminate.obj testfun.obj testfun_api.obj testfun_mex.obj _coder_testfun_info.obj @testfun_mex_mex.arf 14 正在创建库 testfun_mex.x 和对象 testfun_mex.exp 15 'cmd' 不是内部或外部命令,也不是可运行的程序 16 或批处理文件。 17 gmake: * [testfun_mex.mexw64] Error 1
1 comentario
zhenying qin
el 1 de Oct. de 2016
I encounter the same problem now.did you find the possible reasons for the results and solve it in the end?
Respuestas (2)
Matthias
el 21 de Ag. de 2014
1 voto
I had the same Problem. MATLAB could not find the cmd.exe in the system path. cmd.exe is located in C:\Windows\System32
Call the command "getenv PATH" and check if the path is present. If not use for instance http://www.mathworks.com/matlabcentral/answers/94933-how-do-i-set-my-system-path-under-windows to add it.
Hope this helps Matthias
1 comentario
Hari Ijjada
el 28 de Ag. de 2019
i have did the same thing...i have changed the path ...but it is giving same error...what should i do ?
Walter Roberson
el 28 de Ag. de 2019
1 voto
That software is not supported on versions of MS Windows before Windows XP.
6 comentarios
Hari Ijjada
el 28 de Ag. de 2019
but Mine is Windows 7..but it is still giving same error ..what is the remedy for that ?
Walter Roberson
el 28 de Ag. de 2019
I would need a copy of the error message that you are getting. The original poster's error message translates as cmd being an unknown command at the MS Windows level, which is an error you get before Windows XP.
Hari Ijjada
el 29 de Ag. de 2019
lcc64 -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "AM_Modulation_Function_data.c"
lcc64 -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "AM_Modulation_Function_initialize.c"
lcc64 -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "AM_Modulation_Function_terminate.c"
lcc64 -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "AM_Modulation_Function.c"
lcc64 -Fo"_coder_AM_Modulation_Function_info.obj" -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "interface/_coder_AM_Modulation_Function_info.c"
lcc64 -Fo"_coder_AM_Modulation_Function_api.obj" -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "interface/_coder_AM_Modulation_Function_api.c"
lcc64 -Fo"_coder_AM_Modulation_Function_mex.obj" -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "interface/_coder_AM_Modulation_Function_mex.c"
lcc64 -FoAM_Modulation_Function_mex_lccstub.obj -nodeclspec -Zp8 -dll -c -I"C:\MATLAB\R2016a\sys\lcc64\lcc64\include64" -DMATLAB_MEX_FILE -noregistrylookup -DNDEBUG -I"C:\MATLAB\R2016a\simulink\include" -I"C:\MATLAB\R2016a\toolbox\shared\simtargets" -I"E:\Test_C" -I"E:\Test_C\codegen\mex\AM_Modulation_Function" -I".\interface" -I"C:\MATLAB\R2016a\extern\include" -I"." "C:\MATLAB\R2016a\sys\lcc64\lcc64\mex\lccstub.c"
lcclnk64 AM_Modulation_Function_data.obj AM_Modulation_Function_initialize.obj AM_Modulation_Function_terminate.obj AM_Modulation_Function.obj _coder_AM_Modulation_Function_info.obj _coder_AM_Modulation_Function_api.obj _coder_AM_Modulation_Function_mex.obj -dll -L"C:\MATLAB\R2016a\sys\lcc64\lcc64\lib64" -L"C:\MATLAB\R2016a\extern\lib\win64\microsoft" -entry LibMain "AM_Modulation_Function_mex_lccstub.obj" -s -o AM_Modulation_Function_mex.mexw64 libmx.lib libmex.lib libmat.lib libemlrt.lib libcovrt.lib libut.lib libmwmathutil.lib AM_Modulation_Function_mex_mex.def
'cmd' is not recognized as an internal or external command,
operable program or batch file.
gmake: *** [AM_Modulation_Function_mex.mexw64] Error 1
??? Build error: Compilation returned error status code 2.
this is the report of error i got...it will be very helpfull to me if you got a answer for me ..i am spending a lot of time on this
Walter Roberson
el 29 de Ag. de 2019
Possibly you have problems with your PATH environment variable.
Hari Ijjada
el 30 de Ag. de 2019
yes...i had a problem with my PATH environment variable...i added the C/Windows/System32 to my path variable...now i am able to build the mex files..
i have resolved my issue succesfulluy...thank you so much your help
超 陈
el 5 de Jun. de 2020
i had the same problem and i added the C/Windows/System32 to my path variable.but i stll did not solve the problem ,how could i do?
nvcc -Xlinker /nologo -Xlinker /manifest -Xlinker /export:mexFunction -Xlinker /DLL -L"D:\Program Files\MATLAB\R2017b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib -Xlinker /EXPORT:mexFunction -Xnvlink -w -Wno-deprecated-gpu-targets -Xlinker /NODEFAULTLIB:libcmt.lib -o fog_rectification_gpu_mex.mexw64 fog_rectification_data.obj fog_rectification_initialize.obj fog_rectification_terminate.obj fog_rectification.obj _coder_fog_rectification_info.obj _coder_fog_rectification_api.obj _coder_fog_rectification_mex.obj c_mexapi_version.obj -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64" cuda.lib cudart.lib cublas.lib cusolver.lib cufft.lib -Xlinker libemlrt.lib,libcovrt.lib,libut.lib,libmwmathutil.lib,/export:mexFunction,/export:emlrtMexFcnProperties,/export:fog_rectification,/export:fog_rectification_initialize,/export:fog_rectification_terminate,/export:fog_rectification_atexit
libmx.lib
libmex.lib
libmat.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
fog_rectification_data.obj
fog_rectification_initialize.obj
fog_rectification_terminate.obj
fog_rectification.obj
_coder_fog_rectification_info.obj
_coder_fog_rectification_api.obj
_coder_fog_rectification_mex.obj
c_mexapi_version.obj
cuda.lib
cudart.lib
cublas.lib
cusolver.lib
cufft.lib
正在创建库 fog_rectification_gpu_mex.lib 和对象 fog_rectification_gpu_mex.exp
'cmd' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
gmake: *** [fog_rectification_gpu_mex.mexw64] Error 1
Categorías
Más información sobre Texas Instruments C2000 Processors en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!