-5

I tried builing OpenCV with Intel TBB, MKL, TBB+MKL, VTK, Qt, Eigen and CUDA enabled. The CMake build worked just fine and generated the Visual Studio solution without an error.

But while building OpenCV on VS 2017, it fails with this.

opencv_cudev_main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool cv::__termination" (__imp_?__termination@cv@@3_NA) referenced in function DllMain

opencv_cudev400.dll : fatal error LNK1120: 1 unresolved externals

Here are some more details about the current configuration.

  • CMake (v. 3.13.1)
  • OpenCV source (v 4.0.0)
  • OpenCV Contrib (v 4.0.0)
  • Visual Studio 2017(v 15.9.4)
  • CUDA Toolkit (v 10.0)
  • Intel TBB (v 2019 Update 3)
  • Intel MKL (v 2019 Update 3)
  • VTK (v 8.1)
  • Qt (v. 5.12.0)
  • Eigen (v. 3.3.7)
  • OS : Windows 10 (build 1809)

Is there something I am overlooking or do I have to change the versions of libraries I am using so they work with Opencv 4.0.0?

Here's my CMake config string

"C:\Libraries\CMake\bin\cmake.exe" -B"%openCVRoot%\build" -H"%openCVRoot%\core-src" -G"Visual Studio 15 2017 Win64" -DBUILD_opencv_world=ON -DWITH_CUDA=ON -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DWITH_MKL=ON -DMKL_USE_MULTITHREAD=ON -DMKL_WITH_TBB=ON -DWITH_TBB=ON -DINSTALL_TESTS=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_EXAMPLES=OFF -DWITH_QT=ON -DWITH_VTK=ON -DWITH_OPENGL=ON -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_JAVA=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH="%openCVRoot%\contrib-src\modules" -DWITH_EIGEN=ON

MxBx
  • 1
  • 2

1 Answers1

0

Assuming you are trying to build from source : https://github.com/opencv/opencv You need to check whether:

  • PATH variables are correctly set, meaning you should have them pointing to the corresponding library. Otherwise, you need to specify the path manually in CMake
  • You have the correct versions of the libraries you can check here the list https://docs.opencv.org/master/d3/d52/tutorial_windows_install.html as well as explanations
  • if you build libraries by yourself, pay attention that they are in the correct mode (debug/release)
  • You should also check you have every library : I don't see Eigen in your list
  • Check your version of cmake (version >=3.9.1)

EDIT Since you added the error you had I may have an indication :

Similar issue : https://github.com/opencv/opencv/issues/13208

Initial post about same issue : https://github.com/opencv/opencv/issues/12865

Post about the solution : https://github.com/opencv/opencv/pull/13209

The patch #13209 should have resolved your issue.

Patafikss
  • 154
  • 1
  • 2
  • 15
  • Hi Patafikss, just updated my question with more details. Going to try one more time now. Thanks the tip! – MxBx Dec 16 '18 at 18:20