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

problem with Mixed languge configuration

sumaj
Beginner
431 Views
Hi,

My workspace consits of 2 projects, one fortran and the other visual c++ 8.0 which takes fortran lib file as input.
Now if I build my project, fortran is running correctly and giving lib file but after that the following errors are coming. Also Iam calling a fortran subroutine from VC++, Can some body please help?

Error60error LNK2019: unresolved external symbol __iob referenced in function _for__io_returnlibifcoremt.lib
Error61error LNK2001: unresolved external symbol __ioblibifcoremt.lib
Error62error LNK2001: unresolved external symbol __ioblibmmt.lib
Error63error LNK2019: unresolved external symbol ___argv referenced in function _for_rtl_init_libifcoremt.lib
Error64error LNK2019: unresolved external symbol ___argc referenced in function _for_rtl_init_libifcoremt.lib
Error65fatal error LNK1120: 3 unresolved externalsc:\Program Files\MultiLateral 02 04\MultiLateral\Multilateral\Release\MultiLateral.exe1


Regards,
Suma.
0 Kudos
6 Replies
Kevin_D_Intel
Employee
431 Views

Hi Suma,

Appears the C++ project build lacks direction on where the find the Fortran libraries. See if the advice in the following Knowledge Base article (here) helps resolve the issue.
0 Kudos
sumaj
Beginner
431 Views

Hi Suma,

Appears the C++ project build lacks direction on where the find the Fortran libraries. See if the advice in the following Knowledge Base article (here) helps resolve the issue.

Hi Kevin,

Thanks for the help provided. It has helped to solve my problem.

Thankyou.
0 Kudos
bbousman
Beginner
431 Views
Hi, if I may add to this thread: I've got essentially the same error but was not as easily solved as the original poster.

I'm having to bring in an old program that was using VS6 with Compaq Fortran into a slightly more modern era. In this case it's Visual Studio 2005 (maybe someday we'll get current) and Intel Fortran 11.1. I get these linker errors:

1>libifcoremt.lib(for_diags_intel.obj) : error LNK2019: unresolved external symbol __iob referenced in function _for__io_return
1>libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol __iob
1>libmmt.lib(libm_error.obj) : error LNK2001: unresolved external symbol __iob
1>libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol ___argv referenced in function _for_rtl_init_wrap_
1>libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol ___argc referenced in function _for_rtl_init_wrap_

Any suggestions?

Thanks,
Brian

0 Kudos
mecej4
Honored Contributor III
431 Views
I have seen such symptoms when I have tried to link, with some objects (and/or libraries) compiled with /MT and others with /MD. The compilers inject INCLUDELIB directives into the object codes, which leads to mixing libraries inconsistently.

You can tell the linker to produce a map file. Examining the map file is a good way of finding which objects call for LIBCMT.lib and which objects call for MSVCRT.lib. Once you identify the culprits, recompile with the correct /M? option and link.
0 Kudos
bbousman
Beginner
431 Views
Thanks for the answer. I am apparently getting LIBCMT and MSVCRT both included. I'm using /MAP in the linker but end up with an empty map file. All my C++ libraries are using /MD but I'm not sure about the Fortran libraries. It's using the /reentrancy:threaded option right now but I've tried the other options just in case. Any thoughts on why the map is empty? The program does not link successfully.

I'm also doing some web searching to see what I can find so thanks for any answer that can help.

Brian
0 Kudos
bbousman
Beginner
431 Views
I resolved my problem today. I didn't realize that the "Runtime Library" option was in the Fortran "Libraries" section of the properties (since it's in the "Code Generation" section for C++). This is what the previous posters were pointing me towards with the mixed /MD and /MT options. By changing the runtime library to multithread DLL (/libs:dll /threads) the program compiled successfully. Thanks for the help.
0 Kudos
Reply