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

Linker Issues in VS2015

Sam_B_2
Beginner
1,026 Views

I have a codebase (primarily C++ with some C) I am attempting to compile, and I get the following error (end of post) when I attempt to build the solution.

My search has shown that this is likely due to an issue with the FORTRAN compiler (see linker error misery), but I don't have the options available in my project to perform the fix that is used in that thread. Additionally, I am a bit confused, as there do not seem to be any FORTRAN source files anywhere in the files I have, but everything is pointing to this being a FORTRAN error.

1>------ Build started: Project: bemsolver, Configuration: Debug Win32 ------
...
*deleted text*
...
1>  Generating Code...
1>bem.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
1>     Creating library C:\ENT\BemSolver\Debug\bemsolver.lib and object C:\ENT\BemSolver\Debug\bemsolver.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libifcoremt.lib(for_diags_intel.obj) : error LNK2019: unresolved external symbol _vsprintf referenced in function _for__io_return
1>libirc.lib(irc_msg_support.obj) : error LNK2001: unresolved external symbol _vsprintf
1>libifcoremt.lib(for_diags_intel.obj) : error LNK2019: unresolved external symbol ___iob_func referenced in function _for__io_return
1>libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol ___iob_func
1>libmmt.lib(libm_error.obj) : error LNK2001: unresolved external symbol ___iob_func
1>libifcoremt.lib(for_io_util.obj) : error LNK2019: unresolved external symbol _sscanf referenced in function _for_check_env_name
1>libifcoremt.lib(tbk_traceback.obj) : error LNK2001: unresolved external symbol _sscanf
1>libmmt.lib(libm_error.obj) : error LNK2019: unresolved external symbol __snprintf referenced in function ___libm_error_support
1>libirc.lib(tbk_display.obj) : error LNK2001: unresolved external symbol __snprintf
1>libmmt.lib(libm_error.obj) : error LNK2019: unresolved external symbol _vsnprintf referenced in function ___libm_error_support
1>LIBCMT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol _vsnprintf
1>LIBCMT.lib(vsnprintf.obj) : error LNK2001: unresolved external symbol __vsnprintf
1>C:\ENT\BemSolver\Debug\bemsolver.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

0 Kudos
5 Replies
TimP
Honored Contributor III
1,026 Views

The presence of libifcoremt does imply that you have a .obj built by ifort.  It also looks like you have a mixture of static (libirc) and multi-threaded dynamic libraries (all the other .lib references), which is bad.  That may account for the bad news about attempting to link a conflict agains libcmt.  In the past, ifort didn't default to MT, so that was one way this might happen, but you do have MT references from ifort.

You don't show any evidencee of missing Fortran libraries, rather, you are missing C++ library dependencies.  This might raise doubt whether you have updated your VS2015 including C++ support selection.  The libraries which come with ifort don't take care of all library references introduced in C or C++, but they do share some of those. 
 

0 Kudos
Sam_B_2
Beginner
1,026 Views

I have installed VS2015, including VC++ 2015, as I just verified. ifort is only present through the program which I have downloaded, which includes the source to compile.

I have check my ifort folder, containing the .lib files, and there are no .obj files present.

0 Kudos
TimP
Honored Contributor III
1,026 Views

The sketchy installation instruction to which you referred specifies that VS2008 should be installed.  By inference, one would think that ifort libraries supplied would be from a release which supported VS2008, so you may need some luck for it to work with VS2015.  It seems to have been last revised 5 years ago.

0 Kudos
Steven_L_Intel1
Employee
1,026 Views

This topic has come up several times already - Microsoft made breaking changes to the Visual C++ run-time library in VS2015 that requires C/C++ sources to be recompiled. We made changes in the Intel Fortran run-time libraries as of the versions that support VS2015 (Parallel Studio XE 2015 Update 4 and later) to work with this.

I don't know which versions you are using or how you have configured things. You also seem to have a mixture of static and dynamic libraries which just causes problems.

0 Kudos
Sam_B_2
Beginner
1,026 Views

I have resolved this issue with Tim P.'s advice of rolling back to Visual C++ 2008.

0 Kudos
Reply