How can I compile 64bits Fortran MEX-files in Microsoft Visual Studio?

조회 수: 5 (최근 30일)
Manwë
Manwë 2019년 5월 2일
I am trying to adapt the answer the to the question here :
to 64bits, without success.
First, in the link, a step is missing : in "properties > Linker > General > Additional Libraries Directories" one must add the path "C:\Program Files\MATLAB\R2018b\extern\lib\win64\microsoft" as without it libmx.lib and libmex.lib cannot be found
Now, after building in visual studio the output is :
1>Compiling with Intel(R) Visual Fortran Compiler 18.0.0.124 [Intel(R) 64]...
1>yprimef.F
1>yprimefg.F
1>Linking...
1>Creating library C:\path\to\project\folder\yprime_fortran\yprime_fortran\x64\Debug\yprime_fortran.lib and object C:\path\to\project\folder\yprime_fortran\yprime_fortran\x64\Debug\yprime_fortran.exp
1>yprime_fortran.exp : error LNK2001: unresolved external symbol _MEXFUNCTION@16
1>x64\Debug\yprime_fortran.mexw64 : fatal error LNK1120: 1 unresolved externals
As far as I understand, the link concerns the 32bits case, as the module.def contain a EXPORTS _MEXFUNCTION@16, the alias @16 indicating that it's for 16 bits. So I must replace the "_MEXFUNCTION@16" with something different. Because the calling convention STDCALL, REFERENCE stipulated in the link does not exist for fortran (ifort) under 64 bits.
What should I do ?
Should I also modify the yprimeg.F file somehow, to "port" it to 64 bits ?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by