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

libifcoremt.lib linking error in VS 2005

harisha_n
Beginner
958 Views

Hi ,

I'm using Intel Visual Fortran 9.1.34 and Visual Studion 2005 version 8.0.50.

Facing below linking error. (used mixed launguage C & fortran static libraries to build application):

--------------------------------

libifcoremt.lib(for_diags_intel.obj) : error LNK2019: unresolved external symbol __iob referenced in function _for__issue_diagnostic
libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol __iob
libmmt.lib(libm_error.omu) : error LNK2001: unresolved external symbol __iob
libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol ___argv referenced in function _for_rtl_init_
libifcoremt.lib(for_init.obj) : error LNK2019: unresolved external symbol ___argc referenced in function _for_rtl_init_
libifcoremt.lib(for_io_util.obj) : error LNK2019: unresolved external symbol __pctype referenced in function _for__get_number_value
libifcoremt.lib(tbk_traceback.obj) : error LNK2001: unresolved external symbol __pctype
libifcoremt.lib(for_io_util.obj) : error LNK2019: unresolved external symbol ___mb_cur_max referenced in function _for__get_number_value
libifcoremt.lib(tbk_traceback.obj) : error LNK2001: unresolved external symbol ___mb_cur_max

-------------

Please provide mesolution

Thanks,

Harisha

0 Kudos
3 Replies
Steven_L_Intel1
Employee
958 Views

Make sure that you specify the Multithreaded (static) library option (/MT) when compiling the C code.

0 Kudos
psublue
Beginner
958 Views

Make sure that you specify the Multithreaded (static) library option (/MT) when compiling the C code.



Let's say I'm building two different targets. The first is a DLL, which builds fine. The second is an EXE, which gives "error LNK2019: unresolved external symbol __argv referenced in function _for_rtl_init_" at link time.

Both builds share nearly-identical makefiles, and both statically link several libraries which are compiled earlier in the build process. If I want to build an executable, will I need to go back and recompile those libraries with the /MT flag at compile time?

Here's an overview of what happens now:

- Compile lib1 with /MD
- Compile lib2 with /MD
- Compile myDLL with static links to lib1, lib2; use /MD
- Link as a multithreaded DLL

Here's what I think needs to happen to build the executable:

- Compile lib1 with /MT
- Compile lib2 with /MT
- Compile myEXE with static links to lib1, lib2; use /MT
- Link as a multithreaded EXE

If I have it all wrong, I'd certainly appreciate any help you can offer. Thanks!

0 Kudos
Steven_L_Intel1
Employee
958 Views
There's no compelling reason to rebuild with /MT for the executable. Build the libraries with /MD and specify for the EXE that you are linking to the multithreaded DLL libraries, same as with your DLL. You can reuse the static libraries then.
0 Kudos
Reply