Skip to content
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

fontconvert compilation error on MacOS Sonoma M1 #447

Open
mitch-spec opened this issue Jan 18, 2024 · 1 comment
Open

fontconvert compilation error on MacOS Sonoma M1 #447

mitch-spec opened this issue Jan 18, 2024 · 1 comment

Comments

@mitch-spec
Copy link

I am trying to compile fontconvert on MacOS Sonoma M1.
freetype 2.13.2 is already installed and linked via brew.

Compiling fontconvert throws the following error.

make fontconvert
gcc -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include fontconvert.c -lfreetype -o fontconvert
fontconvert.c:22:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
         ^~~~~~~~~~~~
1 error generated.
make: *** [fontconvert] Error 1

When i am adding homebrew's location of freetype there's this error:

make fontconvert
gcc -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include -I/opt/homebrew/include/freetype2 fontconvert.c -lfreetype -o fontconvert
ld: library 'freetype' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fontconvert] Error 1

Do you have any idea how to resolve the issue?

@mitch-spec
Copy link
Author

mitch-spec commented Jan 18, 2024

It compiles as soon as i am adding the following:
CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include -L/opt/homebrew/opt/freetype/lib -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/opt/libpng/include/libpng16

I figured it out with

freetype-config --cflags
freetype-config --libtool
freetype-config --libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant