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

Risposte (2)

Walter Roberson
Walter Roberson il 22 Gen 2012

0 voti

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 Commenti

Marco
Marco il 22 Gen 2012
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
Walter Roberson
Walter Roberson il 22 Gen 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
Marco il 22 Gen 2012
Yes, you're right. The problem is that I am not very expert and I make mistakes in flags changing. Thanks anyway

Accedi per commentare.

Aleksei
Aleksei il 16 Apr 2013

0 voti

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

Categorie

Richiesto:

il 22 Gen 2012

Community Treasure Hunt

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

Start Hunting!

Translated by