Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
21 Views

Fortran C/C++

Hi All,

I have a Digital Fortran - Microsoft C/C++ mix code program compiled under Visual Studio version 6 and would like to move to a newer environment. I have already installed Microsoft Visual Studio 2013 Community Edition with C++ component and have been developing pure C/C++ applications on it. I want to know:
1. Would it be enough to get just "Intel Parallel Studio XE Composer Edition for Fortran Windows"?
2. Would Intel Fortran mix with Microsoft C/C++ code and libraries, especially with MFC?
3. If either 1. or 2. is No, would "Intel Parallel Studio XE Composer Edition for Fortran and C++ Windows" be OK with MFC?

Thanks.

0 Kudos
6 Replies
Highlighted
Black Belt Retired Employee
21 Views

1. Yes
2. Yes
3. N/A

Note that as of VS2002, a single project can no longer have multiple languages. So what happens is that you have a VS "Solution" with two (or more) projects; one for the executable in whichever language the main program is, and one that is a static library for the code in the other language that gets linked in to the executable.

For a DVF project, you may be able to get this split automatically by:

  1. Open the VS6 project with VS2013
  2. Right click on the project and select "Extract Compaq Visual Fortran Project Items" (something like that)

It should split the project and create two as needed. Some tweaking might be needed after that. Visual C++ in VS2013 no longer links in libraries from non-C++ dependent projects, so you have to add the Fortran library (if C++ is main) to the C++ project manually. Also sometimes there will be a /machine:x86 in the "Additional Options" for the Fortran project - if so, remove it.

See also 

0 Kudos
Highlighted
Beginner
21 Views

Thanks Steve, it helps a lot.

0 Kudos
Highlighted
Beginner
21 Views

Hi Steve,
Suppose I use C/C++ for the executable and Fortran for the library, I need to know:
1. in debug, can I step from the C/C++ code into the Fortran library code seamlessly?
2. can Fortran calls C/C++ functions in the executable project or in another C/C++ library?
3. in VS, on right click an function name and select "Find All References", would it show references from the other language?
   i.e., can I look for references from all the projects in the solution?

 

0 Kudos
Highlighted
Black Belt Retired Employee
21 Views

1. Yes

2. Yes.

3. I don't think so. That feature is provided by the language-specific integration and the integrations don't talk to each other. 

0 Kudos
Highlighted
21 Views

You can perform Search Files (select within Solution).

Jim Dempsey

0 Kudos
Highlighted
Beginner
21 Views

Thanks Steve and Jim,

Search would return any line with the searched text, not just those using it as a function call. It is good to know though.

0 Kudos