CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF - Fortran on Windows system (https://www.cfd-online.com/Forums/fluent/36597-udf-fortran-windows-system.html)

Gomer P. May 8, 2005 22:17

UDF - Fortran on Windows system
 
Dear Fluent users,

I have a UDF that calls an external Fortran subroutine.

extern void mff_();

---------------------

The Fortran subroutine is:

subroutine mff()

---------------------

The user_nt.udf includes the file as:

USER_OBJECTS = mff.obj

----------------------

I get the error from the Linker: error LNK2001: unresolved external symbol _mff_

----------------------

Does anyone know how to solve this problem?

Thanks

G.P.

Rajesh G May 16, 2005 01:06

Re: UDF - Fortran on Windows system
 
Probabbly you are getting this error message when you build the program, right? This may be due to following reasons 1) You may ave used underscores(_)anywhere in the program or variable names 2) In your program check for variables which are not declared any where else. i.e by mistake you might have typed some variable names which have neither been assigned any values nor calculated from other variables. Better you should have a complete check on your program.

key:You can check with those variables which have the term "mmf" as a part of its name.

Please read below the Fortran help message for the LNK2001 error

"When you are porting an application from 16 to 32 bits, LNK2001 can occur. The current 32-bit module-definition (.DEF) file syntax requires that __cdecl, __stdcall, and __fastcall functions be listed in the EXPORTS section without underscores (undecorated). This differs from the 16-bit syntax, where they must be listed with underscores (decorated).Any export listed in the .DEF file and not found will cause LNK2001. This could be because it does not exist, is spelled incorrectly, or uses decorated names (.DEF files do not take decorated names). This error message is followed by fatal error LNK1120."

Rajesh G May 16, 2005 01:11

Re: UDF - Fortran on Windows system
 
Sorry it is not mmf but "mff" sorry for the mistake

Rajesh

Ehsan-F July 5, 2011 02:33

Hi Gomer,
I am going to use some FORTRAN files as subroutine in UDF. I have followed the instruction of section 5.4 manual "precompiled object files", but I am getting an error of " the system cannot find the file specified", any idea about that? It may be a basic question but how we can call a subroutine from UDF file?
Thanks
Ehsan

Nikolopoulos July 6, 2011 03:35

Header file
 
Do you have a header file???


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