Compilation error freetype.c:14:10: fatal error: ft2build.h: No such file or directory

I am studying the actual project of Mr. Wei Dongshan, and I want to run it with the code first.

After entering the directory, make has this problem

Because the ft2build.h file is in the freetype2 folder

First look for the freetype2 folder

enter

find / -name freetype2

 Then I found it (I want to compile teacher Wei Dongshan's actual project code, so it must not be in Qt)

I add the path of the folder to the last line of the Makefile file in the project directory I want to compile and compile it.

I only use gcc to compile, if you want to use g++, just add a line

code show as below:

export C_INCLUDE_PATH= [你的头文件的位置]
export CPLUS_INCLUDE_PATH= [你的头文件的位置]

In fact, it tells your compiler the location of the header file

After adding the path, the compilation is successful and the test file is successfully generated

 

 

 (Brother, if you see this, please like it if you don’t bookmark it)

Guess you like

Origin blog.csdn.net/qq_54508596/article/details/125639989