×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Fortran call *.dll

Fortran call *.dll

Fortran call *.dll

(OP)
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

RE: Fortran call *.dll

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.

RE: Fortran call *.dll

(OP)
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  

RE: Fortran call *.dll

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.

RE: Fortran call *.dll

(OP)
Thanks again Richay. I will follow that suggestion.

Avirut
TU Graz

RE: Fortran call *.dll

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
www.dtware.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources