CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Linking to fortran compiler in Windows (https://www.cfd-online.com/Forums/fluent-udf/135377-linking-fortran-compiler-windows.html)

matth301 May 13, 2014 02:23

Linking to fortran compiler in Windows
 
I am running Fluent 15.0 on Windows 7 64 bit. I am trying to compile a UDF that references some Fortran subroutines. I have compiled the subroutines into a static library file, libmc.a. However, when I run nmake to compile the full UDF library, I get the following error:

Quote:

Creating library libudf.lib and object libudf.exp
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol ___chkstk
_ms referenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol _gfortran
_st_write referenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol _gfortran
_transfer_real_write referenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol _gfortran
_st_write_done referenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol _gfortran
_transfer_character_write referenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol lround re
ferenced in function co2_reac_beamup_
libmc.a(co2_reac_beamup.o) : error LNK2019: unresolved external symbol _gfortran
_transfer_integer_write referenced in function co2_reac_beamup_
libmc.a(randdp.o) : error LNK2019: unresolved external symbol trunc referenced i
n function __randdp_MOD_sdprnd
libudf.dll : fatal error LNK1120: 8 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\x86_amd64\link.EXE"' : return code '0x460'
When I have encountered similar errors on Linux, the solution was reference the Fortran compiler in the Makefile:

Code:

    $(LD) $(LDFLAGS) $(OBJECTS) $(USER_OBJECTS) -L/soft/gcc/4.7.2/lib64 -lgfortran -o $@
Does anyone know how to fix this error in Windows? I don't see a linking line in the Fluent UDF makefile for Windows. Thanks for any suggestions!


All times are GMT -4. The time now is 13:16.