CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF - Fortran on Windows system

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2005, 23:17
Default UDF - Fortran on Windows system
  #1
Gomer P.
Guest
 
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?

Thanks

G.P.
  Reply With Quote

Old   May 16, 2005, 02:06
Default Re: UDF - Fortran on Windows system
  #2
Rajesh G
Guest
 
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, 02:11
Default Re: UDF - Fortran on Windows system
  #3
Rajesh G
Guest
 
Posts: n/a
Sorry it is not mmf but "mff" sorry for the mistake

Rajesh
  Reply With Quote

Old   July 5, 2011, 03:33
Default
  #4
New Member
 
Ehsan
Join Date: Jun 2011
Posts: 9
Rep Power: 15
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?
Thanks
Ehsan
Ehsan-F is offline   Reply With Quote

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

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling my Udf noa Fluent UDF and Scheme Programming 8 November 7, 2018 21:08
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 01: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 05:51
Linux to Windows (dual boot system) Alex Main CFD Forum 9 May 3, 2007 04:36


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