- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please bear with me as my knowledge of programming is not very good.
My application written in Fortran via a C function calls and loads up a DLL/SO. Currently the source for the DLL/SO can be C or Fortran. When I write to stdout from the DLL/SO it does not write to the same stdout as my application. Going through the forums I understood that these possible solutions can be used.
1) Use the same run time libraries for both my application and the DLL/SO.
2) Use PROCEDURES with POINTERS (not supported in Fortran90)
Is there any other possible way for this to work?
Thanks for you help. Appreciate any suggestions/comments.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am curious why option 2 is not acceptable to you, though I'm uncertain as to how it is applicable to your situation. What does Fortran 90 have to do with it?
Where do the various outputs go? If the executable program is a "console application" I would expect "stdout" to all go to the console. The executable and the DLLs should all link to the DLL form of the run-time libraries. If they don't, then you will have issues with I/O in that they won't share information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also note that I/O from C is independent from I/O from Fortran. Not sure how this applies to stdout, though.
Steve's question is quite relevant here: what are the differences you are trying to get rid of?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If stdout is buffered (most often it is, unless you have taken steps to change to line-buffering or no buffering, or you flush stdout at the right places), even if the output from the C parts and the Fortran parts reaches the console, the pieces may not arrive in logical order.

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