-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake build err in Mac OS Catalina 10.15.6 #207
Comments
change cmakelists.txt SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY} ${FREETYPE_LIBRARIES}) |
…oeyDeVries#207. Needs to be tested by someone who runs Mac OS.
I have tested it failed. My environmment is Mac OS 10.14.6 on HacMac After I added freetype to CMakeLists.txt and installed freetype, the same compiled error is still there. |
@tainzhi can you please post the error messages? Thanks. |
Also, make sure to add: find_package(Freetype REQUIRED) |
@upupming solution works. Thanks very much. |
my mac system version is 10.15.7, I added ${FREETYPE_LIBRARIES} this in CMakeList.txt, but the same error exists,what can I do? |
@tainzhi @upupming when I add find here # find the required packages
find_package(GLM REQUIRED)
message(STATUS "GLM included at ${GLM_INCLUDE_DIR}")
find_package(GLFW3 REQUIRED)
message(STATUS "Found GLFW3 in ${GLFW3_INCLUDE_DIR}")
find_package(ASSIMP REQUIRED)
message(STATUS "Found ASSIMP in ${ASSIMP_INCLUDE_DIR}")
# find_package(SOIL REQUIRED)
# message(STATUS "Found SOIL in ${SOIL_INCLUDE_DIR}")
# find_package(GLEW REQUIRED)
# message(STATUS "Found GLEW in ${GLEW_INCLUDE_DIR}")
find_package(Freetype REQUIRED) this error appeared when i do 'make ../.' xiaohai:build xiao$ cmake ../. -- Configuring incomplete, errors occurred! |
you should add the git diff is as below diff --git a/CMakeLists.txt b/CMakeLists.txt
index a60f028..a5e7fc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,9 +46,10 @@ elseif(APPLE)
FIND_LIBRARY(OpenGL_LIBRARY OpenGL)
FIND_LIBRARY(IOKit_LIBRARY IOKit)
FIND_LIBRARY(CoreVideo_LIBRARY CoreVideo)
+ FIND_PACKAGE(Freetype REQUIRED)
MARK_AS_ADVANCED(COCOA_LIBRARY OpenGL_LIBRARY)
SET(APPLE_LIBS ${COCOA_LIBRARY} ${IOKit_LIBRARY} ${OpenGL_LIBRARY} ${CoreVideo_LIBRARY})
- SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY})
+ SET(APPLE_LIBS ${APPLE_LIBS} ${GLFW3_LIBRARY} ${ASSIMP_LIBRARY} ${FREETYPE_LIBRARIES})
set(LIBS ${LIBS} ${APPLE_LIBS})
else()
set(LIBS )
(END) |
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[1]: *** Waiting for unfinished jobs....
The text was updated successfully, but these errors were encountered: