2

My build fails with the following message

ld: library not found for -lintl

From what I understand it's talking about libintl.a in the following directory:

dir

I tried doing the following in my cmake file to no avail:

cmake_minimum_required(VERSION 3.8)
project(Visual)

file(GLOB SOURCES src/*.cpp)
file(GLOB HEADERS src/*.h)

add_executable(visual ${HEADERS} ${SOURCES})

find_package(PkgConfig REQUIRED)

[...]

# gettext
find_library(INTL
        NAMES intl libintl
        HINTS "/usr/local/opt/gettext/lib")
if (NOT INTL_FOUND)
    message(WARNING "Did not find intl")
endif ()

target_link_libraries(visual ${INTL})

target_link_libraries(visual ${LIBS})
Vada Poché
  • 763
  • 5
  • 16
jeanluc
  • 1,608
  • 1
  • 14
  • 28
  • 1
    `find_library(INTL)` does NOT set *INTL_FOUND* variable like `find_package()` does. It sets only *INTL* variable, which you have passed as the first parameter. See [documentation](https://cmake.org/cmake/help/v3.7/command/find_library.html). – Tsyvarev Jun 21 '17 at 00:10
  • let CMake show the content of the variable `INTL` to have more insight. F.i. `message("INTL variable: ${INTL}")`. – oLen Jun 21 '17 at 06:52

0 Answers0