IMPORTED_IMPLIB not set for imported target

alice 21 Reputation points
2022-04-08T09:27:18.817+00:00

I already build opencv library.
And write a project to use opencv

When I use generator vs2019, it will show the error.
I check the opencv folder and it has
opencv_structured_light445.lib opencv_reg445.lib opencv_saliency445.lib ...

find_package(OPENCV) can find these library

Here is my command

cmake -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Debug ..




CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_reg" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_rgbd" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_saliency" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_shape" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_stereo" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_structured_light"
  configuration "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_superres" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_surface_matching"
  configuration "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_text" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_tracking" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_videostab"
  configuration "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_wechat_qrcode"
  configuration "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_xfeatures2d"
  configuration "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_ximgproc" configuration
  "RelWithDebInfo".


CMake Error in CMakeLists.txt:
  IMPORTED_IMPLIB not set for imported target "opencv_xobjdetect"
  configuration "RelWithDebInfo".

What should I do? It doesnt show line error.

But I try to use the command. Use ninja

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..

Then it will success.

Windows 8
Windows 8
A Microsoft operating system.
183 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
9,455 questions
0 comments No comments
{count} votes