- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to log any messages to the same file from the main executable and an attached DLL. I have tried to pass the file handle, but that doesn't work. Does one of the newer versions of Fortran allow me to pass a function to be called?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to make sure that your executable is linked to the DLL form of the run-time libraries. Otherwise you will get two copies of the libraries and they won't share open files. In Visual Studio, this is Fortran > Libraries > Use Runtime Libraries > Multithreaded DLL. Make sure that your DLL is set the same way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's great! What flag do I use on the Linux side to do the same thing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use -shared-intel when linking on Linux.
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