Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran call *.dll

Status
Not open for further replies.

avirut

Geotechnical
Feb 3, 2005
13
Hi

Let say, I am going to make 3d interpolation using the function from the *.dll file, namely xtrfun.dll. And I am writting a program in Fortran to call this file.

I have no experience to call *.dll from Fortran before.
Do anybody have any suggestion, e.g. what is information about this that I should read?

Deeply thanks
 
Replies continue below

Recommended for you

There really isn't any difference in writing your code. Just set things up as you would if the interpolation function was another subroutine you wrote as part of your program.

When you set things up to link, make sure you link with the .LIB file associated with the xtrfun.dll file.

Lastly, make sure the xtrfun.dll can by found by the system when you run your program.

Richard Ay
COADE, Inc.
 
Thanks Richay,

However, I am not yet so clear on how to set link even I have already looked at the sample in \DF98\SAMPLES\DLL.
Would you (or anybody) mind to spend your time explaning me?

Avirut
TU Graz
 
I assume you're using Visual Studio - right?

Go to the "project settings" option, then click on the "Link" tab. Add the "xtrfun.lib" to the "object/library modules" edit box.

If you're not using Visual Studio, check the documentation on whatever tool you use to link. This will discuss how you link in additional libraries.

Richard Ay
COADE, Inc.
 
Thanks again Richay. I will follow that suggestion.

Avirut
TU Graz
 
How you call a DLL file from ANY language is dependant on the specific compiler you are using. This is because DLL's have nothing to do with languages. They are an extra and there is nothing standard about them. You need to carefully read the manual that came with your Fortran compiler. There should be some examples for you to follow. You actually do often have to alter your code a little bit... mainly in how you declare some things.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor