Ask Your Question

opencv 2.4.6 cmake configure error. How to fix it?

asked 2013-10-17 10:09:04 -0600

chen gravatar image

The CXX compiler identification is MSVC 16.0.30319.1 The C compiler identification is MSVC 16.0.30319.1 Check for working CXX compiler using: Visual Studio 10 Win64 Check for working CXX compiler using: Visual Studio 10 Win64 -- broken CMake Error at C:/Users/chen/Downloads/cmake- (message): The C++ compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe" is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/opencv_self_buid_10/CMakeFiles/CMakeTmp

Run Build Command:C:\PROGRA~2\MICROS~2.0\Common7\IDE\ CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec4006816612

Microsoft (R) Visual Studio Version 10.0.30319.1.

Copyright (C) Microsoft Corp. All rights reserved.

1>------ Build started: Project: cmTryCompileExec4006816612, Configuration: Debug x64 ------

1> Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64

1> Copyright (C) Microsoft Corporation. All rights reserved.


1> cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec4006816612.dir\Debug\" /Fd"C:/opencv_self_buid_10/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec4006816612.pdb" /Gd /TP /errorReport:prompt testCXXCompiler.cxx


1> testCXXCompiler.cxx

1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

edit retag flag offensive close merge delete


I am using cmake-, and followed, downloaded opencv source code from But I skipped some third party library as I dont think I will need them.

Any one faced the similar problem before??

Thank you so much for your help!

chen gravatar imagechen ( 2013-10-18 21:17:49 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-11-14 22:55:55 -0600

maythe4thbewithu gravatar image

updated 2013-11-14 23:01:24 -0600

I do not test these steps

but you may try

1) Update your SDK, from this

or this

and VS to SP1

SP1 will remove something important, so you need to do step 2 to fix it

2) install the bug-fix from

If after step 1 and 2, you still have the same problem

try (as suggested by Adi Shavit at -- )

1) Right-Click->Properties on cl.exe in your VS install directory (the exact path appears in the CMake error)

2) Choose the Compatibility Tab

3) Check "Run this program as administrator" in the "Privilege Level" box.

edit flag offensive delete link more

Question Tools


Asked: 2013-10-17 10:09:04 -0600

Seen: 4,664 times

Last updated: Nov 14 '13