Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Calling a Fortran Dll on a machine without Fortran installed

Status
Not open for further replies.

BFG2

Technical User
Feb 4, 2003
23
GB
Hi guys and gals,

Have got a load of working Fortran dlls on my computer that work fine and dandy when called from Excel.

However, if I then take all these files to another machine (without Compaq Visual Fortran Installed) and do the same then I just get error messages in Excel. Any suggestions?

This isn't a drive path issue as I've tried the disk in a different machine that DOES run Vis Fortran and it worked fine.

Any help would be greatly appreciated! Thanks for any suggestions you can make.

Regards,

BFG2
 
It is probably some missing DLLs that Vis Fortran has dumped somewhere else. Does it tell you which ones are missing?
 
Did think that, and yes you're right - there are a few dlls the fortran needs. I've copied those both at work and on my home computer into the required directory but without success.

Sorry - should have said that in my post!! Thanks for the suggestion.
 
Have found the issue - it was faily basic.

The Fortran compiler needs to be set to 'Release' compilation rather than 'Debug'
 
Hi all,

may be I am two late but I think you can find information on the necesary runtime libraries (dlls) on the following topic in Visual Studio : Visual Fortran/Visual C++ Mixed-Language Program. This section explains what are the required dlls depending on the compiler options you have choosen.

Regards,
 
BFG2,

I have seen your thread on trying to run your dlls when Visual Fortran is not installed and seems that you were succesful. I am trying to accomplish the same,have some of these fortran dlls made in VF since in basic cant do some complicated math stuff like integration... was wondering if you could give a brief indication on what to do besides building the dll as Release (what free fortran compiler you had in the other computer, other required settings, etc)

Thank you!!

matasapos
 
Matasapos,

See the following thread, this gives you the information you need to call the *.dll from Excel, which is what I needed to do.

thread214-465832

Good luck! Drop a reply if you continue to have trouble. That thread, plus setting the VF compiler to Release was all I needed to get it working.

 
Hi BFG2,

thanks for the info..I am still having trouble...just for testing basically what I did is use the example from the thread you sent me and then use the function in a worksheet...the only change is obviously the path of the library...in Compaq F, all I did is change the active setting configuration to Release, and then obviously in VB the address of the dll file is now in a Relase folder rather than debug..it works fine in my computer with Compaq Fortran, but when I take it to someone elses it tells me it doesnt find the dll..if you could let me know what it may be i would appreciate.I am having a little hard time understranding how the source code is being compiled withput having a fortran compiler in the computer

Thank you
 
Hi matasapos,

The way I understand it, once VF has compiled your functions into a dll, all aspects of Fortran & compiling disappear, and basically Excel/VBA just enters the dll via the entry point that you specified in the original Fortran code i.e.:

!DEC$ ATTRIBUTES DLLEXPORT :: GetPI

Unfortunately I'm not near a computer with VF on it at the moment. If I get the chance I'll retry the example, but I don't know when that will be.

Keep trying with it. This method does work!

Is the file address definitely correct? Once I had figured out the VF needs to be compiled in release mode it was ok. will have a think about your problem. will get back to you.
 
BFG2,

Dont worry, I got it now. I was forgetting to download and install the runtime files from the Compaq Fortran Webpage...working great now, thanks a lot

matasapos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top