Unresolved External errors when compiling an S-Funtion in VS2008
Afficher commentaires plus anciens
[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
Réponse acceptée
Plus de réponses (1)
Kaustubha Govind
le 26 Avr 2011
0 votes
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 commentaires
Richard Beranek
le 26 Avr 2011
Kaustubha Govind
le 26 Avr 2011
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.
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!