Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28634 Discussions

MATLAB "Mex" Unresolved External Reference: _MEXFUNCTION

calabrra
Beginner
405 Views
Hi,
I've got Win 2K / Visual Fortran 6.6 and am trying to compile MathWorks' example file: "matdemo1.f" using:
mex -setup (sets up compiler options --- I selected Visual Fortran 6.6)
mex matdemo1.f -v (the "verbose" option is helpfulatperilous times such as this)
Result: error LNK2001: unresolved external symbol _MEXFUNCTION@16
Compilation resultsattached below.
Do you know what the problem could be?
Thanks
-Bob
Code:
>> mex matdemo1.f -v
 This is mex, Copyright 1984-2003 The MathWorks, Inc. 
 
-> Default options filename found in C:Documents and SettingscalabrraApplication DataMathWorksMATLABR14 
---------------------------------------------------------------- 
->    Options file           = C:Documents and SettingscalabrraApplication DataMathWorksMATLABR14mexopts.bat 
      MATLAB                 = C:MATLAB7 
->    COMPILER               = fl32 
->    Compiler flags: 
         COMPFLAGS           = /fpp:"/m /SC:MATLAB7/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed 
         OPTIMFLAGS          = /MD -Ox -DNDEBUG 
         DEBUGFLAGS          = /MDd -Zi 
         arguments           =  
         Name switch         = /Fo 
->    Pre-linking commands   =  
->    LINKER                 = link 
->    Link directives: 
         LINKFLAGS           = /DLL /EXPORT:_MEXFUNCTION@16 /LIBPATH:"C:MATLAB7externlibwin32digitaldf60" libmx.lib libmex.lib libmat.lib /implib:_lib2762.lib /NOLOGO 
         LINKFLAGSPOST       =  
         Name directive      = "/out:matdemo1.dll" 
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  = @ 
->    Resource Compiler      = rc /fo "mexversion.res" 
->    Resource Linker        =  
---------------------------------------------------------------- 
 
 
--> "fl32  /fpp:"/m /SC:MATLAB7/extern/include" -c -nokeep -G5 -nologo -DMATLAB_MEX_FILE /fixed /Fomatdemo1.obj /MD -Ox -DNDEBUG matdemo1.f" 
 
matdemo1.i 
    Contents of 2762_tmp.rsp: 
  matdemo1.obj 
 
 
--> "link "/out:matdemo1.dll" /DLL /EXPORT:_MEXFUNCTION@16 /LIBPATH:"C:MATLAB7externlibwin32digitaldf60" libmx.lib libmex.lib libmat.lib /implib:_lib2762.lib /NOLOGO  @2762_tmp.rsp " 
 
   Creating library _lib2762.lib and object _lib2762.exp 
_lib2762.exp : error LNK2001: unresolved external symbol _MEXFUNCTION@16 
matdemo1.dll : fatal error LNK1120: 1 unresolved externals 
 
  C:MATLAB7BINWIN32MEX.PL: Error: Link of 'matdemo1.dll' failed. 
 
??? Error using ==> mex
Unable to complete successfully

>> mex matdemo1.f
   Creating library _lib4648.lib and object _lib4648.exp 
_lib4648.exp : error LNK2001: unresolved external symbol _MEXFUNCTION@16 

matdemo1.dll : fatal error LNK1120: 1 unresolved externals 
 
  C:MATLAB7BINWIN32MEX.PL: Error: Link of 'matdemo1.dll' failed. 
 
??? Error using ==> mex
Unable to complete successfully
0 Kudos
0 Replies
Reply