- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I'm running CVF Pro 6.6a, purchased recently.
I need to write a Fortran DLL with exported functions that are callable from a C program. The DLL needs to have REALs as arguments. My C program will pass pointers to doubles to the Fortran DLL function.
The DLL example df98samplesdllDLLEXP1, that ships with CVF Pro 6.6a doesn't compile.
Any suggestions would be greatly appreciated.
I'm running CVF Pro 6.6a, purchased recently.
I need to write a Fortran DLL with exported functions that are callable from a C program. The DLL needs to have REALs as arguments. My C program will pass pointers to doubles to the Fortran DLL function.
The DLL example df98samplesdllDLLEXP1, that ships with CVF Pro 6.6a doesn't compile.
Any suggestions would be greatly appreciated.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What error do you get?
Looking at this example, I see one problem in that the makefile provided (there isn't a workspace) tries to include dfinc.mak, but that file is two levels up in the folder hierarchy. So if you edit MAKEFILE and replace the line to read:
it works (at least it does for me.) Are you having a different problem?
Steve
Looking at this example, I see one problem in that the makefile provided (there isn't a workspace) tries to include dfinc.mak, but that file is two levels up in the folder hierarchy. So if you edit MAKEFILE and replace the line to read:
!include<....dfinc.mak>
it works (at least it does for me.) Are you having a different problem?
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve. I'll make from the command line.
I simply created a new Fortran DLL project and added dll1.for to the project. I compiled.. and VS created a default workspace for me. References to dll2 were not resolved so I removed offending lines from dll1.for. It still would not compile.
I'm returning to Fortran after a 30 year absence. Any tips you could provide for exporting a simple function with no name mangling and with reals as arguments (both input and output arguments ala C) would be greatly appreciated.
Lance
I simply created a new Fortran DLL project and added dll1.for to the project. I compiled.. and VS created a default workspace for me. References to dll2 were not resolved so I removed offending lines from dll1.for. It still would not compile.
I'm returning to Fortran after a 30 year absence. Any tips you could provide for exporting a simple function with no name mangling and with reals as arguments (both input and output arguments ala C) would be greatly appreciated.
Lance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I tried your suggestion...
nmake all
returns the following:
dll2.for
lib /def: dll2.obj
Microsoft Library Manager Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
LIB : fatal error LNK1104: cannot open file "dfordll.lib"
It looks like the path to dfordll.lib isn't made explicit in the dfinc.mak. Do I need to prepend the full path or is there an environment variable I can use?
Thanks,
Lance
I tried your suggestion...
nmake all
returns the following:
dll2.for
lib /def: dll2.obj
Microsoft Library Manager Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
LIB : fatal error LNK1104: cannot open file "dfordll.lib"
It looks like the path to dfordll.lib isn't made explicit in the dfinc.mak. Do I need to prepend the full path or is there an environment variable I can use?
Thanks,
Lance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to start a "Fortran Command Prompt" session - this will define the right environment variables. That's all I did...
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve.. It works great! Now I need to figure out how to do the same from the CVF GUI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You use subprojects - make the DLL projects be subprojects of the executable (Project..Dependencies.). The other thing to do is change the path where the linker creates the DLLs to be the same as the folder where the EXE is built, so that you can run it.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page