Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

fatal error LNK1104 linking MS C++ with Fortran

$
0
0

I have two files source1.f90 and main.cpp the Fortran file has a subroutine and the cpp file has a program that calls the fortran subroutine

I compiled the fortran file and the built a static library file using the following command line options

ifort source1.f90 /nologo /debug:full /Od /gen-interfaces /warn:interfaces /traceback /check:bounds /libs:static /threads /dbglibs /c

lib /out:lib1.lib source1.obj

But when I compiled the cpp file using 

CL main.cpp /link LIB1.LIB

I get the following error 

D:\temp>CL main.cpp /EHsc /link LIB1.LIB
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.cpp
Microsoft (R) Incremental Linker Version 11.00.60610.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe
LIB1.LIB
main.obj
LINK : fatal error LNK1104: cannot open file 'ifmodintr.lib'

How do I fix this problem so that my program compiles

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>