Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Calling Log File from DLL

mattsdad
Beginner
1,023 Views
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?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,023 Views
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.
0 Kudos
mattsdad
Beginner
1,023 Views
That's great! What flag do I use on the Linux side to do the same thing?
0 Kudos
Steven_L_Intel1
Employee
1,023 Views
Use -shared-intel when linking on Linux.
0 Kudos
Reply