Error LNK201 in MEX compilation

Hi everyboy,
I am trying to compile a Fortran code (f90) using "MEX" command.
  • This is my MATLAB version: R2012b;
  • This is my compiler: Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker);
and (unfortunately) this is the only result I've obtained:
Creating library C:\Users\Paolo\AppData\Local\Temp\mex_a9T3Xq\templib.x and object C:\Users\Paolo\AppData\Local\Temp\mex_a9T3Xq\templib.exp
refpropm_PC.obj : error LNK2019: unresolved external symbol MXISSTRING referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol SETUP referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol WMOL referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol XMOLE referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol PHFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TPFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol PDFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol DHFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TDFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol THFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol HSFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol DSFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol PSFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TSFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol DEFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol PEFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TEFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol DQFL2 referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol THERM referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol PQFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TQFLSH referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol MXCREATESCALARDOUBLE referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol XMASS referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol TRNPRP referenced in function MEXFUNCTION
refpropm_PC.obj : error LNK2019: unresolved external symbol SURTEN referenced in function MEXFUNCTION
refpropm_PC.mexw64 : fatal error LNK1120: 25 unresolved externals
Does anybody know how to fix it?
Thanks in advice!
Paolo Conti

5 Kommentare

James Tursa
James Tursa am 8 Okt. 2013
You need to include all source code and library files with the mex command. What mex command did you use?
Kaustubha Govind
Kaustubha Govind am 10 Okt. 2013
Paolo: When you post an answer and "accept" it, it indicates that you have found the resolution to your issue. I would recommend that you delete the answer and post your reply to James' question here as a comment.
James is asking where your functions like PQFLSH, XMASS, etc. are defined, and whether you have linked all relevant files/libraries against your MEX-file.
Also, note that mxIsString has been obsoleted and replaced by mxIsChar and mxCreateScalarDouble has been replaced by mxCreateDoubleScalar.
Paolo Conti
Paolo Conti am 10 Okt. 2013
Bearbeitet: Paolo Conti am 10 Okt. 2013
Thanks Kaustubha for your explanation about the correct use of this forum... I did not know the difference between "comments" and the "answers" (I'm a new user).
I followed your indications and now the compiler works!!
Thanks to both of you for your precious help!!
What should I do now? Create an answer?
Kaustubha Govind
Kaustubha Govind am 10 Okt. 2013
Paolo: You simply need to replace mxIsString with mxIsChar and mxCreateScalarDouble with mxCreateDoubleScalar. Check the documentation to make sure the right syntax is used in your code.
Paolo Conti
Paolo Conti am 11 Okt. 2013
Thank you for your help! Now it works!
What should I do now? Create an answer ?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Signal Integrity Kits for Industry Standards finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 8 Okt. 2013

Kommentiert:

am 11 Okt. 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by