JoeyDeVries/LearnOpenGL

Mac OS X build: -lfreetype missing in CMakeLists.txt

m-bob opened this issue · 1 comments

m-bob commented

The build instructions almost work in Mac OS X Catalina on my (Intel) MacBook Pro.

At almost the last moment, the build fails because make cannot find the freestyle library.

In the file CMakeLists.txt, changing the line
set(LIBS ${LIBS} ${APPLE_LIBS})
to
set(LIBS ${LIBS} ${APPLE_LIBS} -lfreetype)

fixed the problem for me. (I'm no expert on CMake -- or anything, really -- but it looks like this flag is missing only for the Apple build.)

I hope this helps someone.

m-bob commented

gionlime: I already had freetype installed. The linker couldn't find it: therefore my post. Please look at the link flags for the OS's other than Apple. They have the -lfreetype link flag set. It's missing only from the Apple link flags. At least that was true in my situation. My post fixed the problem for me: your post may fix a similar problem for others.