# Configuring Visual Studio for Mixed-Language Applications

Published: 06/02/2011

Last Updated: 04/23/2019

### Introduction

If your application mixes Fortran with C or C++, you must configure Microsoft Visual Studio* to search Fortran include folders and libraries.  This article describes the process for Microsoft Visual Studio 2017, 2015, 2013, 2012, 2010, 2008, 2005 and 2003, and applies to the following products:

• Intel® Parallel Studio XE 2019 supports Microsoft Visual Studio 2017, 2015, and 2013 (deprecated). In the text below, substitute 19 where [vv] is shown.
• Intel® Parallel Studio XE 2018 supports Microsoft Visual Studio 2017, 2015, and 2013. In the text below, substitute 18 where [vv] is shown.
• Intel® Parallel Studio XE 2017 supports Microsoft Visual Studio 2017, 2015, 2013, and 2012. In the text below, substitute 17 where [vv] is shown.
• Intel® Parallel Studio XE 2016 supports Microsoft Visual Studio 2015, 2013, 2012 and 2010. In the text below, substitute 16 where [vv] is shown.
• Intel® Parallel Studio XE 2015 supports Microsoft Visual Studio 2013, 2012 and 2010. In the text below, substitute 15 where [vv] is shown.
• Intel® Visual Fortran Composer XE 2013 SP1 supports Microsoft Visual Studio 2013, 2012, 2010 and 2008. In the text below, substitute 14 where [vv] is shown.
• Intel® Visual Fortran Composer XE 2013 supports Microsoft Visual Studio 2012, 2010 and 2008. In the text below, substitute 13 where [vv] is shown.
• Intel® Visual Fortran Composer XE 2011 supports Microsoft Visual Studio 2010, 2008 and 2005. In the text below, substitute 12 where [vv] is shown.
• Intel® Visual Fortran Compiler Professional Edition 11.1 supports Microsoft Visual Studio 2008, 2005 and 2003. In the text below, substitute 11 where [vv] is shown.

### Configuring Microsoft Visual Studio 2003, 2005 or 2008

This configuration needs to be done one time only per install of Microsoft Visual Studio.

Open Microsoft Visual Studio.  Select Tools > Options. In the left pane, expand Projects and Solutions,  click on VC++ Directories. (Visual Studio .NET 2003 uses "Projects" instead of "Projects and Solutions") and then select "Library Files" for "Show directories for".

Click on the New Line button (to the right of the "check mark" button) and enter the following new line if you are using Intel Visual Fortran XE 2011 or newer:

$(IFORT_COMPILER[vv])compiler\lib\ia32 (remember to substitute for [vv] as described above) or the following new line if you are using Intel Visual Fortran 11.x:$(IFORT_COMPILER11)lib\ia32

Click OK.

If you will be developing for the Intel 64 architecture, repeat the above steps, using the Platform dropdown to select "x64" (Intel 64) . When entering the path, use "intel64" instead of "ia32". Note that Microsoft Visual Studio 2003 does not support the x64 platform. If you do not see x64 as an available platform, see the Fortran Release Notes for instructions on how to configure Microsoft Visual Studio for 64-bit development.

If you are using Visual Studio 2005, you must install Visual Studio 2005 Service Pack 1, otherwise your Fortran project will not be found when linking the C/C++ project.

### Configuring Microsoft Visual Studio 2017, 2015, 2013, 2012 or 2010

NOTE: In Microsoft Visual Studio 2010 and later, a C++ project will not link in a non-C++ dependent project library. If you are using a C/C++ main program with a Fortran static or dynamic library as a dependent project, you must explicitly provide the path to the Fortran library, (the .lib export library in the case of a DLL project), in the C/C++ project's Linker > Additional Dependencies property, or as a "source file" in the project. If your C++ project references ISO_Fortran_binding.h, also add libifcoremd.lib to Additional Dependencies.

NOTE: In Microsoft Visual Studio 2010 and later, a Fortran project will not link in a C++ DLL dependent project.  A C++ static library dependent project will be linked in. If your Fortran project has a dependent C/C++ DLL project, you must explicitly provide the path to the C++ project's DLL export library (.lib) in the Fortran project's Linker > Additional Dependencies property, or as a "source file" in the project.

1. In Visual Studio, with a solution open that contains a C++ project, select View > Property Manager. If you do not see Property Manager under the View menu, you will find it under View > Other Windows. The Property Manager window will appear. Note that this is not Properties Window or Properties Pages.
2. Click on the triangles or + signs to expand the property tree under the Debug|Win32 configuration. See the image below.
3. Double click on Microsoft.Cpp.Win32.user
4. Select VC++ Directories
5. Click in the field to the right of "Include Directories"
6. Click the triangle that appears to the right and select <Edit...>
7. Click the New Line button or press Ctrl-Insert
8. In the new field that appears, type:
$(IFORT_COMPILER[vv])\compiler\include (remember to substitute for [vv] as described above) 9. Click OK 10. Click in the field to the right of "Library Directories" 11. Click the triangle that appears to the right and select <Edit...> 12. Click the New Line button or press Ctrl-Insert 13. In the new field that appears, type:$(IFORT_COMPILER[vv])\compiler\lib\ia32
(remember to substitute for [vv] as described above)
14. Click OK, OK
15. In the Visual Studio toolbar, select File > Save All

If you will be building Intel® 64 (x64) configurations:

1. Back in the Property Manager, expand the Debug|x64 configuration
2. Double click on Microsoft.Cpp.x64.user
3. Select VC++ Directories
4. Click in the field to the right of "Include Directories"
5. Click the triangle that appears to the right and select <Edit...>
6. Click the New Line button or press Ctrl-Insert
7. In the new field that appears, type:
$(IFORT_COMPILER[vv])\compiler\include (remember to substitute for [vv] as described above) 8. Click OK 9. Click in the field to the right of "Library Directories" 10. Click the triangle that appears to the right and select <Edit...> 11. Click the New Line button or press Ctrl-Insert 12. In the new field that appears, type:$(IFORT_COMPILER[vv])\compiler\lib\intel64
(remember to substitute for [vv] as described above)
13. Click OK, OK
14. In the Visual Studio toolbar, select File > Save All

Click on the Solution Explorer tab, or press Ctrl-Alt-L, to make it visible again.

If you do not see the Microsoft.Cpp.x64.user property page listed for the x64 configuration, right
click on Debug|x64 and select Add Existing property Sheet. Browse to the location which
contains the MsBuild 4.0 property pages. On Windows XP, this is typically:

On Windows Vista* ,Windows 7* and later it is typically:

You may need to enable viewing of hidden files and folders to see these paths.

Select Microsoft.Cpp.x64.user.props and click Open. Now follow the steps above.

### For More Help

If you need further assistance with configuring Visual Studio to link with Fortran, please ask in our User Forum.

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.