Take the 2-minute tour ×

When I try to generate the MEX file from the Fortran source code (TEINITG.F), Matlab always gives errors.After downloading the trial versions of Intel Visual Fortran 11.1 Microsoft Visual C++ 2008 SP1 linker, I used mex -setup to configure the environment. Then I tried to generate mex functions from FORTRAN Source Code (TEINITG.F).

However, when I type: mex TEINITG.F

Matlab shows link errors, like:

    Creating library C:\Users\xue\AppData\Local\Temp\mex_TDkmp3\templib.x and object 
 TEINITG.obj    : error LNK2019: unresolved external symbol _TEINIT referenced in function 
 TEINITG.mexw32 : fatal error LNK1120: 1 unresolved externals

 C:\PROGRA~2\MATLAB\R2010B~1\BIN\MEX.PL: Error: Link of 'TEINITG.mexw32' failed.

I am running MATLAB R2010b-32bit on windows-64 bit. Might that be the source of problem? I do not know how to deal with this error. Do you have any suggestions that may fix this problem?

share|improve this question
Is there subroutine TEINIT in your code? –  Vladimir F Dec 23 '12 at 20:48
yes, there is. Why ? –  ceydaok Dec 23 '12 at 22:30
Could this be a name mingling issue with the Fortran compiler? –  ZZZ Dec 10 '13 at 20:01
add comment


Your Answer



Browse other questions tagged or ask your own question.