Configuring Microsoft Visual Studio* for Mixed-Language Applications

ID 659211
Updated 4/10/2025
Version Latest
Public

author-image

By

Configuring Microsoft Visual Studio 2022 or 2019

NOTE: 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:  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. Double Click on Debug|x64 configuration (See the image below)
  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

 

     

     

     

    Building Debug|Win32 configuration (Classic ifort and icc only):

    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. Double click on Debug|Win32 configuration.  
    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\ia32
      (remember to substitute for [vv] as described above)
    13. Click OK, OK
    14. In the Visual Studio toolbar, select File > Save All

     

    1