Building with visual studio, after Cmake fails

asked 2017-05-11 22:33:38 -0600

Dirty_Feri gravatar image

updated 2017-05-12 03:14:04 -0600

When i try to build the OpenCV libaries in VS 2015 it fails.

I opened the ALL_BUILD, than clicked on build, i get 249 error. Many of these are Linker Error complaining that it can not see the opencv_world320d.lib, and its right i can not either. The first couple of errors are not Linker errors, but the rest are.

cmd after clone:

image description

here is my opencv folder: image description

CMake Error log (configuration went through, with some errors)

Build output check failed:
    Regex: 'unknown .*option'
    Output line: 'cl : Command line warning D9002: ignoring unknown option '-fsigned-char' [B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\cmTC_70be5.vcxproj]
'
Compilation failed:
    source file: 'B:/Programming/OpenCV/opencv/Build/CMakeFiles/CMakeTmp/src.cxx'
    check option: '  -fsigned-char'
===== BUILD LOG =====
Change Dir: B:/Programming/OpenCV/opencv/Build/CMakeFiles/CMakeTmp

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

Copyright (C) Microsoft Corporation. All rights reserved.



Build started 5/12/2017 2:10:02 AM.

The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the project, and will be ignored.

Project "B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\cmTC_70be5.vcxproj" on node 1 (default targets).

PrepareForBuild:

  Creating directory "cmTC_70be5.dir\Debug\".

  Creating directory "B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\Debug\".

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

InitializeBuildStatus:

  Creating "cmTC_70be5.dir\Debug\cmTC_70be5.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- /EHa /RTC1 /MDd /GS /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_70be5.dir\Debug\\" /Fd"cmTC_70be5.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue   -fsigned-char B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\src.cxx

  Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 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- /EHa /RTC1 /MDd /GS /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_70be5.dir\Debug\\" /Fd"cmTC_70be5.dir\Debug\vc140.pdb" /Gd /TP /errorReport:queue   -fsigned-char B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\src.cxx



cl : Command line warning D9002: ignoring unknown option '-fsigned-char' [B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\cmTC_70be5.vcxproj]

  src.cxx

Link:

  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"B:\Programming\OpenCV\opencv\Build\CMakeFiles\CMakeTmp\Debug\cmTC_70be5.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:"B:/Programming/OpenCV/opencv/Build/CMakeFiles/CMakeTmp/Debug/cmTC_70be5.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"B:/Programming/OpenCV/opencv/Build/CMakeFiles/CMakeTmp ...
(more)
edit retag flag offensive close merge delete

Comments

disable opencv_world in cmake

LBerger gravatar imageLBerger ( 2017-05-12 00:12:05 -0600 )edit

its not needed?

Dirty_Feri gravatar imageDirty_Feri ( 2017-05-12 01:20:20 -0600 )edit

opencv_world means that you have only one dll. If you disable it you will have many dlls. It's easier to locate problem with many dlls. When it works without opencv_world you can enable opencv_world if you like (it's a big dll)

LBerger gravatar imageLBerger ( 2017-05-12 01:26:58 -0600 )edit

in the configuration window i unchecked opencv_world, opencv_world_AVX, opencv_world_AVX2; however i still get the same linker errors (it looks for the opencv_world320.lib), but this time there is 10 succeeded

Dirty_Feri gravatar imageDirty_Feri ( 2017-05-12 01:54:12 -0600 )edit

Delete CmakeCache.txt and build opencv and give first error

LBerger gravatar imageLBerger ( 2017-05-12 01:57:10 -0600 )edit

updated the question

Dirty_Feri gravatar imageDirty_Feri ( 2017-05-12 02:11:38 -0600 )edit

Delete CmakeCache.txt : it is in cmake gui. Build opencv without cuda WITH_CUDA uncheck and disable all module with cuda clean solution before build solution http://perso.univ-lemans.fr/~berger/A... and http://perso.univ-lemans.fr/~berger/A...

LBerger gravatar imageLBerger ( 2017-05-12 02:22:41 -0600 )edit

i don't see, that it's building any opencv libs, it starts directly building samples/perf_tests.

this is for sure wrong. you still have artefacts from your prev. attempt there. can you try to delete the whole build folder, and start from scratch with cmake running from an empty build folder ?

berak gravatar imageberak ( 2017-05-12 02:28:25 -0600 )edit

i just tried cmake without CUDA, opencv_world, from scratch and added the results. It does finish the config, however there are some stuff that fails, and some files that it can not find

Dirty_Feri gravatar imageDirty_Feri ( 2017-05-12 02:41:09 -0600 )edit

Back to basic : Have you clone opencv using git or download zip file? Have you choose Visual studio 14 2015 win 64 in cmake?

LBerger gravatar imageLBerger ( 2017-05-12 02:52:30 -0600 )edit