holding both fortran and c++ files within the same VC project

beppe patrizi 0 Reputation points
2023-08-03T14:50:22.8333333+00:00

The project is done with a set of fortran files, that are the main part of the code. So, the VS project was built as a console app in Fortran.

The project is completed with some C files, that must generate some .mod files to interface some fortran calls and, more, a resource file (.rc).
The whole project has been well tested for years with other IDE systems and other compilers.

As an example, the Winteracter IDE handles the same project as a unique list of files, then the IDE itself chooses the correct compiler following the usual suffix conventions.

For what I have understood, it should be possible to force VS to apply the C++ compiler to each ".c" or ".cpp" file instead of Ifort, but the properties panels does not show any way to do this.

Also tried to use these C files in a separate project, build the .mod files separately and then trying to load them in the fortran project: apart from the inconvenience of two separate environments, I found no any way to ask the fortran compiler for loading these interfaces.

Someone may help? Many thanks in advance. BP

Developer technologies | Visual Studio | Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.