我的构建失败并显示以下消息
ld: library not found for -lintl
根据我的理解,它在以下目录中讨论libintl.a
:
我尝试在我的cmake文件中执行以下操作无效:
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})