Ask Your Question
2

Is OpenCv 3.0 compatible for VS 2015

asked 2015-09-09 05:19:53 -0500

Nitin Mane gravatar image

Need to configure the setting for OpenCv for VS2015 as it require C++ for making directory files and other setting for same 32 and 64 bit.

edit retag flag offensive close merge delete

Comments

If it works please accept the answer ... It would be usefull to see an accepted answer on this subject :)

pklab gravatar imagepklab ( 2015-09-09 10:17:00 -0500 )edit

3 answers

Sort by » oldest newest most voted
3

answered 2015-11-08 09:03:39 -0500

Eponymous gravatar image

updated 2015-11-08 13:19:43 -0500

I just built OpenCV 3.0 from source on Visual Studio Community 2015 both debug and release x64 on Windows 10:

The key was to check out the version after pull request 5212 was merged: 421e1b237c4c0024f46a9ab06ca23497d8cb2204 This fixes issue 5007: Error in Building OpenCV for Microsoft VS 2015.

The steps were (using MinGW bash shell):

git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 421e1b237c4c0024f46a9ab06ca23497d8cb2204 -b with-vc2015-fix
cmake-gui & # Then set destination dir, configure, configure, generate

Then, open OpenCV.sln in Visual Studio. It will be building the Debug target. Right-click on ALL_BUILD, select build. Wait until it finishes, Go to the CMakeTargets project, Right click on INSTALL and select build. Then, switch to Release mode and repeat the menu selections you did for the Debug target.

edit flag offensive delete link more

Comments

What is then your version control giving by cv::getbuildinformation()?

LBerger gravatar imageLBerger ( 2015-11-08 09:38:19 -0500 )edit
2

answered 2015-09-09 07:19:43 -0500

LBerger gravatar image

updated 2015-09-09 11:38:02 -0500

Yes it is compatible. You should disable BUILD__opencv_adas if you build opencv with opencv_contrib. I have testet it with opencv 3.0-dev and VS 2015 with windows 10-64bits

General configuration for OpenCV 3.0.0-dev ===================================== Version control: 3.0.0-beta-1436-g945aa06-dirty

Platform: Host: Windows 6.2 AMD64 CMake: 3.3.0

Microsoft Visual Studio Enterprise 2015 Version 14.0.23107.0 D14REL Microsoft .NET Framework Version 4.6.00079

Version installée : Enterprise

edit flag offensive delete link more
1

answered 2015-11-07 21:33:54 -0500

updated 2015-11-08 01:19:47 -0500

After trying to build OpenCV 3.0 from source (fresh download from https://github.com/Itseez/opencv) by both VS 2015 Professional and Enterprise editions on a Win 7 64 bit machine, my conclusion is: currently, OpenCV 3.0 can not be built with VS 2015 due to an ICE: https://connect.microsoft.com/VisualS.... Hope VS 2015 update 1 can rectify this problem.

edit flag offensive delete link more

Comments

that's a problem for you not for me. I haven't got any error in debug or release

using getbuildinformation I have got this

General configuration for OpenCV 3.0.0-dev =====================================
  Version control:               3.0.0-652-g259d9f7-dirty

  Platform:
    Host:                        Windows 6.2 AMD64
    CMake:                       3.3.0
    CMake generator:             Visual Studio 14 2015 Win64
    CMake build tool:            C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
    MSVC:                        1900

Where have you got an error?

LBerger gravatar imageLBerger ( 2015-11-08 02:23:27 -0500 )edit

Actually solving your problem is quite straightforward ... just disable the extra compiler option /O2 than it should not occur!

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-08 03:23:34 -0500 )edit

I tried to disable both /O2 and precompiled headers options but the errors still remained. I post my configurations here so some one can suggest a solution:

General configuration for OpenCV 3.0.0-dev =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.1 AMD64
    CMake:                       3.3.2
    CMake generator:             Visual Studio 14 2015 Win64
    CMake build tool:            C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
    MSVC:                        1900

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe  (ver 19.0.23026.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /G
tuannhtn gravatar imagetuannhtn ( 2015-11-08 05:47:00 -0500 )edit

@LBerger, could you check if your C++ compiler and flags are the same?

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-08 05:58:03 -0500 )edit

@tuannhtn Where is exactly your error ? First part

C / C++ :
Built as dynamic libs ? : YES
C++ Compiler : C : / Program Files(x86) / Microsoft Visual Studio 14.0 / VC / bin / x86_amd64 / cl.exe(ver 19.0.23026.0)
C++ flags(Release) : / DWIN32 / D_WINDOWS / W4 / GR / EHa / D _CRT_SECURE_NO_DEPRECATE / D _CRT_NONSTDC_NO_DEPRECATE / D _SCL_SECURE_NO_WARNINGS / Gy / bigobj / Oi / wd4251 / wd4324 / wd4275 / wd4589 / MP12 / MD / O2 / Ob2 / D NDEBUG / Zi
C++ flags(Debug) : / DWIN32 / D_WINDOWS / W4 / GR / EHa / D _CRT_SECURE_NO_DEPRECATE / D _CRT_NONSTDC_NO_DEPRECATE / D _SCL_SECURE_NO_WARNINGS / Gy / bigobj / Oi / wd4251 / wd4324 / wd4275 / wd4589 / MP12 / D_DEBUG / MDd / Zi / Ob0 / Od / RTC1
LBerger gravatar imageLBerger ( 2015-11-08 06:55:48 -0500 )edit

second

C Compiler : C : / Program Files(x86) / Microsoft Visual Studio 14.0 / VC / bin / x86_amd64 / cl.exe
C flags(Release) : / DWIN32 / D_WINDOWS / W3 / D _CRT_SECURE_NO_DEPRECATE / D _CRT_NONSTDC_NO_DEPRECATE / D _SCL_SECURE_NO_WARNINGS / Gy / bigobj / Oi / MP12 / MD / O2 / Ob2 / D NDEBUG / Zi
C flags(Debug) : / DWIN32 / D_WINDOWS / W3 / D _CRT_SECURE_NO_DEPRECATE / D _CRT_NONSTDC_NO_DEPRECATE / D _SCL_SECURE_NO_WARNINGS / Gy / bigobj / Oi / MP12 / D_DEBUG / MDd / Zi / Ob0 / Od / RTC1

Linker flags(Release) : / machine : x64 / INCREMENTAL : NO / debug
Linker flags(Debug) : / machine : x64 / debug / INCREMENTAL
Precompiled headers : YES
LBerger gravatar imageLBerger ( 2015-11-08 06:57:20 -0500 )edit

Thanks @LBerger, the error was: INTERNAL COMPILER ERROR: fatal error C1001 (compiler file '...\vctools\compiler\utc\src\p2\main.c', line 246). I checked your configuration details and they are the same as mine. If possible, could you compress and send your full worled solution to me via email?

tuannhtn gravatar imagetuannhtn ( 2015-11-08 08:29:32 -0500 )edit

@tuannhtn You can download solution (with opencv contrib) here. It is all folder generated by cmake to buil opencv.

I have clone opencv in f:/lib and choose to build opencv with vs2015 in f:/lib/opencv/dyn2015. I have compressed folder f:/lib/opencv/dyn2015

LBerger gravatar imageLBerger ( 2015-11-08 09:12:33 -0500 )edit
1

Thanks @LBerger, I will check and let you know the results.

tuannhtn gravatar imagetuannhtn ( 2015-11-08 10:47:36 -0500 )edit

I put opencv and opencv_contrib into the folder F:\lib and build (from F:\lib\opencv\dyn2015) and encoutered following errors:

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
2>------ Skipped Build: Project: RUN_TESTS, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration 
1>  Checking Build System
1>  The system cannot find the path specified.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3.
3>------ Build started: Project: opencv_hal, Configuration: Release x64 ------
4>------ Build started: Project: zlib, Configuration: Release x64 ------
5>------ Build started: Project: libjasper, Configuration: Release x64 ------
6>------ B
tuannhtn gravatar imagetuannhtn ( 2015-11-08 11:24:56 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-09-09 05:19:53 -0500

Seen: 2,628 times

Last updated: Nov 08 '15