c file compile problem

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

回答(2 个)

Walter Roberson
Walter Roberson 2012-1-22

0 个投票

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 个评论

I have seen the page, it suggests to use OpenWatcom to compile Makefile under Windows. But there is no versione available of OpenWatcom for 64 bit OS
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.
Yes, you're right. The problem is that I am not very expert and I make mistakes in flags changing. Thanks anyway

请先登录,再进行评论。

Aleksei
Aleksei 2013-4-16

0 个投票

Marco, I vave the same problem and cannot build fminuit mex file. Could you help me ofc if you found solution? Thanks.

类别

帮助中心File Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

提问:

2012-1-22

Community Treasure Hunt

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

Start Hunting!

Translated by