Unresolved External errors when compiling an S-Funtion in VS2008
이전 댓글 표시
[EDIT: 20110609 23:06 CDT - reformat - WDR]
I am trying to compile an S-Function using VS 2008.
I have followed the instructions to compile an s-function from
<http://www.mathworks.com/support/solutions/en/data/1-5Q6YOE/index.html?product=ML&solution=1-5Q6YOE> .
I have included the relevant libraries (libmx.lib libmat.lib libmex.lib) their linking directories as well as included "mex.h". However, I still get the following errors from the compiler:
1>Control.obj : error LNK2001: unresolved external symbol _mexWarnMsgTxt
1>Control.obj : error LNK2001: unresolved external symbol _mexCallMATLAB
1>Control.obj : error LNK2001: unresolved external symbol _mxCreateString
1>Control.obj : error LNK2001: unresolved external symbol _mxGetClassID
1>Control.obj : error LNK2001: unresolved external symbol _mxGetPr
1>Control.obj : error LNK2001: unresolved external symbol _mxCreateDoubleMatrix_730
1>Control.obj : error LNK2001: unresolved external symbol _mxIsNumeric
1>Control.obj : error LNK2001: unresolved external symbol _mxIsComplex
1>Control.obj : error LNK2001: unresolved external symbol _mxGetN
1>Control.obj : error LNK2001: unresolved external symbol _mxGetM
1>Control.obj : error LNK2001: unresolved external symbol _mexErrMsgTxt
1>Control.obj : error LNK2001: unresolved external symbol _mxCalloc
채택된 답변
추가 답변 (1개)
Kaustubha Govind
2011년 4월 26일
0 개 추천
Have you also ensured step 4 (Add "$MATLABROOT\extern\lib\win32\microsoft" in the options Linker->General->Additional Library Directories). Note that if you have 64-bit MATLAB, you need to swap win32 with win64. Double-check that the relevant libraries are present in whatever folder you add to the directories list.
댓글 수: 2
Richard Beranek
2011년 4월 26일
Kaustubha Govind
2011년 4월 26일
Have you also configured MSVC to target 64-bit platforms (I think it tries to build a 32-bit DLL by default). See http://msdn.microsoft.com/en-us/library/9yb4317s%28v=vs.80%29.aspx
Also, set .mexw64 as the extension.
카테고리
도움말 센터 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!