- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a previousCompaq Visual Fortran user just beginning to gain familiarity with MS Visual Studio.
I am trying to stand up existing C and Fortran code. The main .c program calls the driver routine for the Fortran via an extern void [fortran_program_name_entry_] statement.
The Fortran code then calls mostly fortran routines, but also some c routines.
Within MSVS -> File -> New Project options, I do not see a meansto set up a "mixed project" that would include both C and Fortran routines, within whichI wouldinclude all existing.f and .inc files along with all.c and .h files.
Therefore my current strategy is to create an Intel Visual Fotran Static Library project (containing all ofthe .f and .inc files), and a Visual C++ Class Library Project (containing all of the .c and .h files). The Build products by each of those projects would be .libs.
I would thenlike to create a Main C project as a Win 32 Console Application containing only the main.c program (driver routine). The build product from that project would be an executable thatIcouldrun ina console window. Ultimately I would like to write a test driver routine and invoke the debugger to step through the code top to bottom.
What is the correct approach for building a C executable with both Fortran and C .lib dependendies?Within MSVS, I don't see how to point the C exe to Fortran and C .libs.
In general, I'm not sure if what I've described here is the best strategy or even a viable strategy. Is there anydocumentation specific to what I'm trying toaccomplish?
I appreciate any/all advice and guidance on the best approach for standing up a C driver that invokes Fortran which in turn calls other Fotran and C routines, and ultimately for adding a driver to invoke the debugger.
Thank you
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1) main project: win32 C/C++ project
2) Fortran lib: a Fortran static lib or dynamic dll project
3) C lib project: win32 C/C++ statid or dynamic dll project
Under [Project] menu, select "Project Dependency" to add the dependency like below:
. Fortran lib project: depend on C lib project
. main project: depend on Fortran lib project
then it should be ready to go.
There is a big section talking about mixed C/Fortran language programming in the Fortran user's guide.
I feel that your question might be better answered in our Fortran forum in case my answer above is not enough, so let me transfer this to there.
thanks,
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good to know the approach is sound.
I'll consult the Fortran User's Guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a link to the section in the user's guide mentioned above:
http://127.0.0.1:47873/help/1-6716/ms.help?method=page&id=MAIN_FOR-430D0852-00001F&topicversion=0&topiclocale=EN-US&SQM=1&product=VS&productVersion=100&locale=EN-US
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page