Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

.for files do not compile in mixed C++/FORTRAN Windows DLL

Mark_L_7
Beginner
642 Views

I am trying to migrate a WIN32 DLL that includes C++ and FORTRAN modules from Compaq Visual FORTRAN to Intel Visual FORTRAN with Microsoft Visual Studion 2012  The FORTRAN modules currently compile as a "Custom Build Tool" from the command prompt.  I was hoping that by upgrading to the Intel compiler that the FORTRAN modules would be recognized as a registered build item but that does not appear to be the case.  I do not see a way to select the FORTRAN compiler from the property pages.

I can certainly configure a "Custom Build Tool" with proper compiler syntax, but I wonder if I am missing something?

(I can build FORTRAN only projects fine and all the packages seem to be installed correctly according to Intel's documentation).

 

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
642 Views

The way you have to do this in VS2002 and later is create separate projects for the C++ and Fortran code in one solution. Microsoft removed the ability to have two languages in a single project. For a DLL, pick one language as a DLL project and the other as a static library, making sure that the runtime library settings for the static library are set to the same as for the DLL project. You then make the static library a "dependent" project of the DLL project and build the solution.

When converting from CVF, the "Extract Compaq Visual Fortran Project Items" wizard will do most of this work for you, but it seems you're doing something it isn't prepared to handle.

0 Kudos
Mark_L_7
Beginner
642 Views

Thanks for the reply.  I thought that might be a Visual Studio limitation.  I'll probably start with using a custom build step and then migrate to the static library of the Fortran only modules.

0 Kudos
Steven_L_Intel1
Employee
642 Views

You'll have to add the paths to the Fortran executables in the C++ directory list in order to get ifort recognized in a C++ project. My advice is to skip the custom build step and move to separate projects. You'll get the full benefits of the Fortran integration then.

0 Kudos
Reply