使用MSYS2使用ITK库时的链接错误2
我希望使用Windows下的MSYS2使用ITK编译程序。当我使用Cmake生成Makefile时,我会收到此错误。
CMake Error at CMakeLists.txt:36 (target_link_libraries):
Target "itkComparaison" links to:
GTest::GTest
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
有了这个cmakelists,
cmake_minimum_required(VERSION 3.16)
project(itkComparaison)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_executable(
itkComparaison
main.cpp
....h
....cpp
)
find_package(ITK CONFIG REQUIRED)
target_link_libraries(itkComparaison ${ITK_LIBRARIES})
您曾经遇到过这个错误吗?
I am looking to compile a program using ITK with MSYS2 under Windows. When I generate my makefile with CMAKE, I get this error.
CMake Error at CMakeLists.txt:36 (target_link_libraries):
Target "itkComparaison" links to:
GTest::GTest
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
with this CMakeLists
cmake_minimum_required(VERSION 3.16)
project(itkComparaison)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_executable(
itkComparaison
main.cpp
....h
....cpp
)
find_package(ITK CONFIG REQUIRED)
target_link_libraries(itkComparaison ${ITK_LIBRARIES})
Have you ever encountered this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论