JoeyDeVries/LearnOpenGL

Does not build on Mac OSX

lpapp opened this issue · 2 comments

lpapp commented

[ 68%] Linking CXX executable ../bin/7.in_practice/7.in_practice__2.text_rendering
Undefined symbols for architecture x86_64:
"_FT_Done_Face", referenced from:
_main in text_rendering.cpp.o
"_FT_Done_FreeType", referenced from:
_main in text_rendering.cpp.o
"_FT_Init_FreeType", referenced from:
_main in text_rendering.cpp.o
"_FT_Load_Char", referenced from:
_main in text_rendering.cpp.o
"_FT_New_Face", referenced from:
_main in text_rendering.cpp.o
"_FT_Set_Pixel_Sizes", referenced from:
_main in text_rendering.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../bin/7.in_practice/7.in_practice__2.text_rendering] Error 1
make[1]: *** [CMakeFiles/7.in_practice__2.text_rendering.dir/all] Error 2
make: *** [all] Error 2
lpapp@Laszlos-MacBook-Pro build %

lpapp commented

The same error occurs in 2D games. I created a separate file to learn 2D games, and it didn't work until I added the following to the cmakelist file:

find_package(Freetype REQUIRED)
SET(APPLE_LIBS ${APPLE_LIBS} ${FREETYPE_LIBRARIES} )
set(LIBS ${LIBS} ${APPLE_LIBS})
if (APPLE)
    target_link_libraries(Breakout_new ${LIBS})
endif()

CLion MacBook Air