c file compile problem
Show older comments
I'm trying to compile fminuit.c, present in this package: http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/fminuit-src.tar.gz
I have selected with 'mex -setup':
Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0
as the compiler. When I try to run 'mex fminuit.c' in order to obtain .m and .mexw64 files (I've windows 7 64 bit), I have this errors:
----------------------------
mex fminuit.c
Creating library C:\Users\Marco\AppData\Local\Temp\mex_qPAAfM\templib.x and object C:\Users\Marco\AppData\Local\Temp\mex_qPAAfM\templib.exp
fminuit.obj : error LNK2019: unresolved external symbol mnemat_ referenced in function build_errmat
fminuit.obj : error LNK2019: unresolved external symbol mnerrs_ referenced in function build_errmat
fminuit.obj : error LNK2019: unresolved external symbol doflush referenced in function mexFunction
fminuit.obj : error LNK2019: unresolved external symbol mnintr_ referenced in function mexFunction
fminuit.obj : error LNK2019: unresolved external symbol mnexcm_ referenced in function mexFunction
fminuit.obj : error LNK2019: unresolved external symbol mnparm_ referenced in function mexFunction
fminuit.obj : error LNK2019: unresolved external symbol mnseti_ referenced in function mexFunction
fminuit.obj : error LNK2019: unresolved external symbol mninit_ referenced in function mexFunction
fminuit.mexw64 : fatal error LNK1120: 8 unresolved externals
C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Link of 'fminuit.mexw64' failed.
Error using mex (line 206) Unable to complete successfully.
------------------------------------
Do you have any suggestion about this problem?
Thanks.
Marco
Answers (2)
Walter Roberson
on 22 Jan 2012
0 votes
You did not link against the fortran part of the package. See the instructions at http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/Fminuit_building.html
3 Comments
Marco
on 22 Jan 2012
Walter Roberson
on 22 Jan 2012
That doesn't mean you can skip the Makefile step; the Makefile builds pieces and links them together. It just means you have to substitute a different compiler and different flags in the make file.
Marco
on 22 Jan 2012
Aleksei
on 16 Apr 2013
0 votes
Marco, I vave the same problem and cannot build fminuit mex file. Could you help me ofc if you found solution? Thanks.
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!