Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

C++ and Fortran mixed code link error

drake__steve
Beginner
302 Views

Hello,

I’m using Visual Studio 2017 Community with the Intel Fortran compiler. With my current configuration the “C_calls_Fortran" example contained in the “MixedLanguage" package from Intel builds and runs on Win32 but does not fully build on x64. I get a LNK1104 error, cannot open file 'kernel32.lib’ with x64. 

 
for x64.
 
I’ve looked at and tried a lot of examples in the forum to no avail. In Project Properties, settings in VC++ Directories are:
 
Include Directories: $(IFORT_COMPILER18)\compiler\include\intel64;$(IncludePath)
Library Directories: $(IFORT_COMPILER18)\compiler\lib\intel64;$(LibraryPath)
 
there are more than a few versions of kernel32.lib loaded on my computer and I’m guessing that I’m referencing the wrong one. The value of IncludePath is:
 
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_20189.1.156\windows\\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\T
 
Ideas for fixing this problem?
 
Thanks.
0 Kudos
2 Replies
Lorri_M_Intel
Employee
302 Views

It wouldn't be the INCLUDE environment variable that controlled finding a .lib file; it would be the LIB environment variable.

Please check the LibraryPath

 

                 --Lorri

0 Kudos
drake__steve
Beginner
302 Views

I found the problem. I was missing a paren in one of the macros. Doh!

 

0 Kudos
Reply