1

I’ve been trying to install OPENCV 2.4.13.6 into a GPU-equipped Windows10 machine (CUDA9.0, VS2015, cmake3.10.0 have already been installed). Though trying to install the opencv 2.4 by referring to https://jamesbowley.co.uk/build-compile-opencv-3-4-in-windows-with-cuda-9-0-and-intel-mkl-tbb/, I got following error.

Error message:

The CXX compiler identification is MSVC 19.0.24215.1
The C compiler identification is MSVC 19.0.24215.1
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- broken
CMake Error at share/cmake-3.10/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler

"C:/Program Files (x86)/Microsoft Visual Studio 14.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/opencv-2.4.13.6/built/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_678c6.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
Microsoft (R) Build Engine version 14.0.25420.1

Copyright (C) Microsoft Corporation. All rights reserved.


Build started 2018/10/28 21:46:10.

Project "C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\cmTC_678c6.vcxproj" on node 1 (default targets).

PrepareForBuild:

Creating directory "cmTC_678c6.dir\Debug\".

Creating directory "C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\Debug\".

Creating directory "cmTC_678c6.dir\Debug\cmTC_678c6.tlog\".

InitializeBuildStatus:

Creating "cmTC_678c6.dir\Debug\cmTC_678c6.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

ClCompile:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_678c6.dir\Debug\\" /Fd"cmTC_678c6.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue "C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\testCXXCompiler.cxx"

Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x64

Copyright (C) Microsoft Corporation. All rights reserved.


cl /c /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_678c6.dir\Debug\\" /Fd"cmTC_678c6.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue "C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\testCXXCompiler.cxx"


testCXXCompiler.cxx

Link:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\Debug\cmTC_678c6.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/opencv/opencv-2.4.13.6/built/CMakeFiles/CMakeTmp/Debug/cmTC_678c6.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/opencv/opencv-2.4.13.6/built/CMakeFiles/CMakeTmp/Debug/cmTC_678c6.lib" /MACHINE:X64 /machine:x64 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib cmTC_678c6.dir\Debug\testCXXCompiler.obj

LINK : fatal error LNK1104: cannot open file 'C:\Program.obj' [C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\cmTC_678c6.vcxproj]

Done Building Project "C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\cmTC_678c6.vcxproj" (default targets) -- FAILED.


Build FAILED.


"C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\cmTC_678c6.vcxproj" (default target) (1) ->

(Link target) -> 

LINK : fatal error LNK1104: cannot open file 'C:\Program.obj' [C:\opencv\opencv-2.4.13.6\built\CMakeFiles\CMakeTmp\cmTC_678c6.vcxproj]


0 Warning(s)

1 Error(s)


Time Elapsed 00:00:00.42





CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:64 (project)
Configuring incomplete, errors occurred!
See also "C:/opencv/opencv-2.4.13.6/built/CMakeFiles/CMakeOutput.log".
See also "C:/opencv/opencv-2.4.13.6/built/CMakeFiles/CMakeError.log".

Though I've been trying to fix this error referring to below URLs for a week, those solution on the URLs did not work with me.

CMake configuring fails. "cl.exe is not able to compile a simple test program"

Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?

I would sincerely appreciate for your kind instruction to solve this issue.

talonmies
  • 70,661
  • 34
  • 192
  • 269
mush_head
  • 11
  • 2
  • Ask to Nvidia, they used to answer. –  Oct 29 '18 at 22:47
  • They do the VS integration too. –  Oct 29 '18 at 22:52
  • Thank you so much for your kind comment. I think this problem is not derived from NVIDIA software since I can ran tensorflow-gpu and cupy code successfully using this PC ( on ipython). Am I using wrong c++ compiler?? – mush_head Oct 30 '18 at 03:04
  • @mush_head Cuda 9 is very recent, opencv 2.4 is ancient I have a feeling you cannot compile both of them together. I've successfully compiled opencv 3.4 with cuda 9.2 on visual studio 2017 without python. – Rakshith G B Oct 30 '18 at 09:25
  • @Rakshith Gb , Thank you so much for your kind reply. I tried openCV 3.3 and 3.4 but did not work neither and both got similar error as well as 2.4. Since I am currently using this environment with python (Cupy and tensorflow-gpu), I would like not to change version of CUDA and visual basic for these libraries re-installation, if possible... – mush_head Oct 30 '18 at 11:15
  • @mush_head opencv 3.3 works with cuda 8, 3.4 with cuda 9.1. You can get tensorflow for any cuda version ill share the link containing wheel files for all versions of tensorflow depending on cuda. – Rakshith G B Oct 30 '18 at 11:34
  • @Rakshith Gb ,Following your instruction, I reinstalled CUDA9.1, VS2017, and then, try to cmake with source files of opencv3.4. However, I still got a similar error as following URL. https://www.evernote.com/shard/s80/sh/3b3e6eec-9a6d-49cd-ad5a-4ad2a9ef9c0b/d0a337deb7385f1577bcccebffe0c0b6 – mush_head Oct 30 '18 at 17:58
  • since I could not compile with cmake as mentioned above, I download the binary from a website (https://jamesbowley.co.uk/downloads/#OpenCV3.4), and then add its include file into system environmental path, and then try to compile a opencv using code with using cmake. but I also got following error message. https://www.evernote.com/shard/s80/sh/bac49d07-3795-466d-a906-83c4bf23139c/4ae634aef4c5f811031115dc63ab589b I think this problem occured between my cmake setting problem which cannot properly use visual studio's c++ compiler(?) does any body can kindly instruct me how to solve it? – mush_head Oct 31 '18 at 00:59

0 Answers0