CFD Online Logo CFD Online URL
Home > Forums > FLUENT

UDF - Fortran on Windows system

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   May 8, 2005, 22:17
Default UDF - Fortran on Windows system
Gomer P.
Posts: n/a
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?


  Reply With Quote

Old   May 16, 2005, 01:06
Default Re: UDF - Fortran on Windows system
Rajesh G
Posts: n/a
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."
  Reply With Quote

Old   May 16, 2005, 01:11
Default Re: UDF - Fortran on Windows system
Rajesh G
Posts: n/a
Sorry it is not mmf but "mff" sorry for the mistake

  Reply With Quote

Old   July 5, 2011, 02:33
New Member
Join Date: Jun 2011
Posts: 9
Rep Power: 6
Ehsan-F is on a distinguished road
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?
Ehsan-F is offline   Reply With Quote

Old   July 6, 2011, 03:35
Default Header file
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 6
Nikolopoulos is on a distinguished road
Do you have a header file???
Nikolopoulos is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling my Udf noa Fluent UDF and Scheme Programming 6 November 2, 2012 07:52
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 00:52
Windows 7 related error while building UDF? sega FLUENT 0 February 25, 2010 08:12
help: udf compiling problem on 64 bit windows XP Hsieh FLUENT 2 September 10, 2009 04:51
Linux to Windows (dual boot system) Alex Main CFD Forum 9 May 3, 2007 03:36

All times are GMT -4. The time now is 08:44.