Problem linking Intel-built library in Visual Studio 6 project: Unresolved externals
I've made a library for someone, using Intel compiler 10.1. Now when linking, his compiler - Visual Studio 6 (!) - complains about a number of unresolved externals. And he doesn't want to switch to a different compiler...
I managed to get rid of some of them, among other __libm_sse2_sincos, by turning off generating SSE2 code - I'm now targetting a Pentium 3. Linking in libmmt.lib (+libircmt.lib + smvl_disp.lib) in VS6 failed - the libmmt.lib causes some internal linker error with no further information on what's going on.
After switching to P3 optimizing I'm left with these 2 unresolved externals: __intel_VEC_memzero __intel_f2int
Which has now been fixed by manually implementing these functions in VS6 (without optimizations, of cause).
Is there a better way to get rid of these unresolved externals? For example by telling the Intel compiler not to use them? Or a solution to be able to use them in VS6? I've tried turning off using intrinsics functions; that didn't help.
What you are attempting to do something that can take quite a bit of effort: making the objects of one version of Ifort work with libraries made for an earlier version of Intel-C/MSVC.
A C++ compiler uses calls to runtime library routines for I/O, runtime errors, and exception handling. Since there is no standard specification for many of these routines, you cannot in general mix runtime libraries from different versions of a given compiler or those from different Fortran compilers.
I've eventually managed to solve the issue by upgrading to a newer Intel compiler version just for this library (I get the best performance with version 10.1), and using the switch /Qfreestanding. This lets the compiler assume that there are no other libraries available, so it doesn't use anything from those libraries. This option is availble since version 11.x of the compiler, hence the upgrade.
The library that contains the unresolved symbols (__intel_VEC_memzero, __intel_f2int) should be on the list of in the 10.1 redistributable libs.
What you could do is 1. to build the library using /MT option that will link all the other libraries statically. Or link the 10.1 IntelC static libs directly by adding them to the "Link.exe" options. 2. Or you can provide the .lib/.dll to your customer to link.