microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.13k stars 6.37k forks source link

[harfbuzz] undefined reference to `FT_Get_Var_Blend_Coordinates`, `FT_Done_MM_Var`, `FT_Set_Var_Blend_Coordinates` #25620

Closed wutipong closed 1 year ago

wutipong commented 2 years ago

Host Environment

To Reproduce Steps to reproduce the behavior:

Failure logs

[build] /usr/bin/ld: vcpkg_installed/x64-linux/debug/lib/libharfbuzz.a(hb-ft.cc.o): in function `hb_ft_font_changed':
[build] /home/wutt/font-render-tester/vcpkg/buildtrees/harfbuzz/x64-linux-dbg/../src/4.2.0-5b564b3e93.clean/src/hb-ft.cc:933: undefined reference to `FT_Get_MM_Var'
[build] /usr/bin/ld: /home/wutt/font-render-tester/vcpkg/buildtrees/harfbuzz/x64-linux-dbg/../src/4.2.0-5b564b3e93.clean/src/hb-ft.cc:939: undefined reference to `FT_Get_Var_Blend_Coordinates'
[build] /usr/bin/ld: /home/wutt/font-render-tester/vcpkg/buildtrees/harfbuzz/x64-linux-dbg/../src/4.2.0-5b564b3e93.clean/src/hb-ft.cc:958: undefined reference to `FT_Done_MM_Var'
[build] /usr/bin/ld: vcpkg_installed/x64-linux/debug/lib/libharfbuzz.a(hb-ft.cc.o): in function `hb_ft_font_set_funcs':
[build] /home/wutt/font-render-tester/vcpkg/buildtrees/harfbuzz/x64-linux-dbg/../src/4.2.0-5b564b3e93.clean/src/hb-ft.cc:1108: undefined reference to `FT_Set_Var_Blend_Coordinates'
[build] collect2: error: ld returned 1 exit status

Additional context

set the project name

project(font-render-tester)

add the executable

add_executable(font-render-tester "main.cpp" "scene.hpp" "scene.cpp" "imgui-filebrowser/imfilebrowser.h" "texture.hpp" "texture.cpp" "main_scene.hpp" "main_scene.cpp" "font.cpp" "font.hpp" "text_renderer.hpp" "text_renderer.cpp" "context.cpp" "test_scene.cpp" "draw_rect.cpp" "draw_glyph.hpp" "draw_glyph.cpp" "io_util.hpp" "gl_util.hpp" "gl_util.cpp")

target_compile_features(font-render-tester PRIVATE cxx_std_17) set_property(TARGET font-render-tester PROPERTY CXX_STANDARD 17) set_property(TARGET font-render-tester PROPERTY CXX_STANDARD_REQUIRED ON)

if (MSVC) set_property(TARGET font-render-tester PROPERTY WIN32_EXECUTABLE ON) target_compile_options(font-render-tester PRIVATE /Zc:__cplusplus) endif()

find_package(SDL2 CONFIG REQUIRED) find_package(freetype CONFIG REQUIRED) find_package(gl3w CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) find_package(harfbuzz CONFIG REQUIRED) find_package(imgui CONFIG REQUIRED) find_package(spdlog CONFIG REQUIRED) find_package(utf8cpp CONFIG REQUIRED)

target_include_directories(font-render-tester PRIVATE ${STB_INCLUDE_DIRS})

target_link_libraries(font-render-tester PRIVATE SDL2::SDL2 SDL2::SDL2main imgui::imgui harfbuzz harfbuzz::harfbuzz utf8cpp unofficial::gl3w::gl3w freetype spdlog::spdlog spdlog::spdlog_header_only)

file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSans-Regular.ttf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansThai-Regular.ttf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKjp-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKkr-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/fonts/NotoSansCJKsc-Regular.otf" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/fonts")

file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_rect.vert" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_rect.frag" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_glyph.vert" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders") file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/shaders/draw_glyph.frag" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders")

FrankXie05 commented 1 year ago

find_package(freetype CONFIG REQUIRED)

If you use freetype provided by vcpkg, please use the correct way:

find_package(Freetype REQUIRED)
target_link_libraries(main PRIVATE Freetype::Freetype) # since CMake 3.10
github-actions[bot] commented 1 year ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.