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

Command line linking with different VS versions

dajum
Novice
448 Views

I'm trying to link a number of libraries that are all built using the Platform toolset V100, but the main routine is compiled and linked with composer XE2013 with VS2012. (but the idea is to support all versions of the compiler and VS).  But with one of the libraries I get the LNK2038 mismatch detected for _MSC_VER 1700.  Is there a way in a command line to specify the platform toolset?  I get messages when I've tried to add /p:PlatformToolset=v100 that it isn't recognized.   Seems to be okay if I use a project in VS, but I need to use the command line as well.

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
448 Views

The command line environment is configured with the compilervars.bat or ipsxe-comp-vars.bat script. This takes two arguments. The first, which is required, is the platform, either ia32 or intel64. The second, which is optional, is the VS version to be used for tools and libraries. By default it picks the latest VS you have installed, or you can say vs2013, vs2012, vs2010. Maybe you just need to invoke this with vs2010 as the second argument.

I'll be honest and say I have never heard of this error before, which must be an MSVC thing. Intel Fortran is much less picky about mixing VS versions when linking than MSVC is.

0 Kudos
Lars_L_
Beginner
448 Views

Hello
I think I have a similiar problem.
I have used VS2012 and Intel Visual Fortran Compiler XE 13.1.1.171
to build a Fortran DLL. One of the fortran routines call a C/C++ functions and these are build as a static lib
Everything works fine on my computer

But if I move the Fortran files and the STATIC lib(compiled with Vs2012) to a computer
with VS2013 and uses that tool to build the Fortran DLL
I got these Messages:
Fehler   3             error LNK2038: Konflikt ermittelt für "_MSC_VER": Der Wert "1800" stimmt nicht mit dem Wert "1700" in CC_XXX_Conv.lib(XXXXX.obj) überein.       libcpmtd.lib(xlock.obj) 
           
The CC_XXX_Conv.lib is the static lib


It seems to be an issue with the toolset used .
I have tried the method suggested by Steve ( running compilervars.bat as a Pre-build Event)
Same problem...

Anyone know top solve this ?


A question how to I set the toolset in the vfproject ?
or in the linker command line?


 

0 Kudos
mecej4
Honored Contributor III
448 Views

You may attempt to resolve the problem by recompiling your C/C++ sources with the /D_ALLOW_MSC_VER_MISMATCH option. The same goes for libraries that you build and use in the project. If you have third party libraries that contribute to the mismatch, you may have to obtain updated libraries, or downdate your newer objects to regain compatibility.

0 Kudos
Reply