[CMake] Problem with Intel Fortran and the Visual Studio 2008 generator
Brad King
brad.king at kitware.com
Tue Sep 28 10:18:50 EDT 2010
On 9/28/2010 6:35 AM, Arjen Markus wrote:
> for the PLplot project (http://plplot.sf.net) I have tried to use
> the Visual Studio 2008 generator in combination with Intel Fortran
> (version 11.1). Generating the solution and the project files
> works fine, but when I try to build it all, I get error messages
> about various symbols being doubly defined (in libcmt.lib - __aenvptr,
> __wenvptr, ___error_mode and ___app_type) and also a missing symbol
> in libifcoremt.lib (_MAIN__).
>
> These are system libraries that get included automatically during the
> link step.
>
> If I use the NMake Makefiles generator, however, all goes well.
I can reproduce this with VS 2008 and Intel 11.1 in 32-bit mode:
LIBCMT.lib(dllcrt0.obj) : error LNK2005: __aenvptr already defined in LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: __wenvptr already defined in LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: ___error_mode already defined in LIBCMT.lib(crt0.obj)
LIBCMT.lib(dllcrt0.obj) : error LNK2005: ___app_type already defined in LIBCMT.lib(crt0.obj)
Note that one comes from "dllcrt0.obj" and the other from "crt0.obj".
The build is mixing static and shared runtime libraries.
It looks like the Platform/Windows-ifort.cmake module is not getting
loaded for this generator. This is due to a dumb bug in the language
information files. I've pushed out a fix:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20f49730
-Brad
More information about the CMake
mailing list