[CMake] Check for working C compiler using: Visual Studio 10 -- broken

Bill Hoffman bill.hoffman at kitware.com
Tue Mar 5 10:58:36 EST 2013


On 3/5/2013 10:45 AM, Mateusz Loskot wrote:
> Hi,
>
> Here is my environment:
> - Windows 7 (64-bit).
> - CMake 2.8.10.2
> - Visual Studio 2010 Professional
> - Visual Studio 2012 Professional (Update 1)
>
> All VS installations work well with hand-crafted projects,
> no problems building from IDE, no problems building from
> corresponding command line prompts.
>
> I launch Visual Studio Command Prompt (2010) and try to configure
> CMake-based project, and I'm getting the status from the subject line.
>
> Here is detailed CMake output:
>
> ----------------------------------------------------------------------------------------------------
> d:\dev\soci\_git\build-sqlite3>cmake -G "Visual Studio 10" ..\soci\src
> -- The C compiler identification is MSVC 16.0.30319.1
> -- The CXX compiler identification is MSVC 16.0.30319.1
> -- Check for working C compiler using: Visual Studio 10
> -- Check for working C compiler using: Visual Studio 10 -- broken
> CMake Error at C:/Program Files (x86)/CMake
> 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
>    The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
>    10.0/VC/bin/cl.exe" is not able to compile a simple test program.
>
>    It fails with the following output:
>
>     Change Dir: D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp
>
>    Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\devenv.com
>    CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec2214779388
>
>    Microsoft (R) Visual Studio Version 10.0.30319.1.
>    Copyright (C) Microsoft Corp.  All rights reserved.
>
>    1>------ Build started: Project: cmTryCompileExec2214779388, Configuration:
>    Debug Win32 ------
>
>    1>Build started 05/03/2013 15:34:40.
>    1>PrepareForBuild:
>    1> Creating directory
>    "D:\dev\soci\_git\build-sqlite3\CMakeFiles\CMakeTmp\Debug\".
>    1>InitializeBuildStatus:
>    1> Creating
>    "cmTryCompileExec2214779388.dir\Debug\cmTryCompileExec2214779388.unsuccessfulbuild"
>    because "AlwaysCreate" was specified.
>    1>ClCompile:
>    1> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> 16.00.30319.01 for 80x86
>    1> Copyright (C) Microsoft Corporation.  All rights reserved.
>    1>
>    1> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
>    "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
>    /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec2214779388.dir\Debug\\"
>    /Fd"D:/dev/soci/_git/build-sqlite3/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec2214779388.pdb"
>    /Gd /TC /analyze- /errorReport:prompt testCCompiler.c /Zm1000
>    1>
>    1> testCCompiler.c
>    1>LINK : fatal error LNK1123: failure during conversion to COFF:
> file invalid or corrupt
>    1>
>    1>Build FAILED.
>    1>
>    1>Time Elapsed 00:00:00.44
>    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
>    CMake will not be able to correctly generate this project.
> Call Stack (most recent call first):
>    CMakeLists.txt:15 (project)
>
> -- Configuring incomplete, errors occurred!
>
> d:\dev\soci\_git\build-sqlite3>
> ----------------------------------------------------------------------------------------------------
>
>
> I have searched Web and this kind of error seems to be recurring,
> some users even suggest to uninstall/reinstall Visual Studio...
> Note, both VS versions work well with projects I already have.
>
> I'm confused, what is the correct solution?

I found this:

http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c

You could run cmake --debug-trycompile, then load the .sln file in the 
CMakeTmp directory with the IDE and see why it does not work.  Sounds 
like a .NET version issue.  I would try some of the stuff in that 
stackoverflow link.

>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the CMake mailing list