OpenCV 245 first building errors

opencv

Solution

Quick Answer

I have managed to compile OpenCV with TBB support using the tutorial here.

Specs: Visual Studio 2012/ Win 7 (64 bit)/ OpenCV 2.4.5/ CUDA 5

I have downloaded the latest TBB zip and extracted it to C:/src/OpenCV/dep (as suggested in the tutorial linked above).

You have to use the following TBB settings in CMake (adapt depending on your file paths):

TBB_LIB_DIR       ::  C:/src/OpenCV/dep/tbb41_20130314oss/lib/intel64/vc11
TBB_INCLUDE_DIRS  ::  C:/src/OpenCV/dep/tbb41_20130314oss/include/
TBB_STDDEF_PATH   ::  C:/src/OpenCV/dep/tbb41_20130314oss/include/tbb/tbb_stddef.h
WITH_TBB          ::  checked
BUILD_TBB         ::  unchecked

More Information

Initially, I also wanted to install OpenCV with CUDA 5 support, but it seems that CUDA 5 is incompatible with VS2012. This is the error I got when compiling OpenCV:

Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/src/cuda/Debug/cuda_compile_generated_matrix_operations.cu.obj
nvcc : fatal error : nvcc cannot find a supported cl version. Only MSVC 9.0 and MSVC 10.0 are supported

The good news is that you are using VS2010, which can be used with CUDA, as suggested here. VS2012 can be set up to create projects with CUDA, but there is currently no way (AFAIK) to compile OpenCV with CUDA support for VS2012 (read this for more info).

In conclusion, people that need CUDA support should compile and use OpenCV with VS2010.

Also, when compiling OpenCV, I got the following errors:

error C3859: virtual memory range for PCH exceeded; please recompile with a command line option of '-Zm118' or greater
fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit

I used the instructions here to finally compile OpenCV. I created a Property Sheet which had `/Zm130` as an additional option in Common Properties > C/C++ > Command Line and added it to all of the generated OpenCV projects.

For your reference, I also attach the CMake configuration and CMakeCache.txt file that I've used (CUDA is disabled as I am using VS2012):

- CMake configuration: http://pastebin.com/8rJZGZ3T

- CMakeCache.txt: http://pastebin.com/A0q8YgJg

Hope this helps and please comment if you need me to elaborate on any step.

Problem

I downloaded the sources of opencv-2.4.5 and I followed the tutorial (on the opencv site for windows) about the installing my own libraries everything. Ok. I created the opencv.sln file with cmake then I opened it with visual studio 2010 professional and I click the build solution but just 9 succeeded. Most of the 200 failed and most of the errors about tbbd.lib not found and opencv_core245d.lib not found with LNK1104 error. I'm trying to solve it for how many days. I've tried to show the ways of files... Anyone can help please? This is about my dissertation. (Build with No Common Language Support)

Original source

Related problems