Ask Your Question
0

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-2.8.11.2-win32-x86/cmake-2.8.11.2-win32-x86/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (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\devenv.com 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>

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>

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

Comments

I am using cmake-2.8.11.2-win32-x86, and followed http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html, downloaded opencv source code from https://github.com/Itseez/opencv.git. 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
0

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 http://www.microsoft.com/en-us/download/details.aspx?id=3138

or this http://www.microsoft.com/en-us/download/details.aspx?id=8279

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

http://www.microsoft.com/en-us/download/details.aspx?id=4422


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

try (as suggested by Adi Shavit at -- http://stackoverflow.com/questions/14590947/cmake-configuring-fails-cl-exe-is-not-able-to-compile-a-simple-test-program )

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

Stats

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

Seen: 4,664 times

Last updated: Nov 14 '13