1 year ago

#373093

test-img

riton

link error when using ITK Library with MSYS2

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?

c++

cmake

msys2

itk

0 Answers

Your Answer

Accepted video resources