[英]g++ header files in include subdirectory
我通過調用freetype2 / ft2build.h頭文件來包含freetype2庫。
#include <freetype2/ft2build.h>
頭文件本身調用子目錄中的另一個頭文件。
#include <config/ftheader.h>
這會導致“ make”失敗。
/usr/include/freetype2/ft2build.h:37:29: fatal error: config/ftheader.h: No such file or directory
#include <config/ftheader.h>
config子目錄位於freetype2內,但是編譯器顯然在/ usr / include目錄中尋找它。
我無法找到解決方案,但是我不可能是唯一會受到影響的解決方案。 我想念什么?
我嘗試將INCLUDE=-I/usr/include/freetype2/config
到makefile中,但這不起作用。
Makefile如下
INCLUDE=-I/usr/include/freetype2
CC=g++
LDLIBS=-lglut -lGLEW -lGL
all: main
clean:
rm -f *.o main
.PHONY: all clean
我認為您需要更換
#include <freetype2/ft2build.h>
與
#include <ft2build.h>
和使用
INCLUDE=-I/usr/include/freetype2
在makefile中
更改了我的Mkefile。
CPPFLAGS=-I/usr/include/freetype2 -I/usr/include/freetype2/config
CC=g++
LDLIBS=-lglut -lGLEW -lGL
all: main
clean:
rm -f *.o main
.PHONY: all clean
從INCLUDE到CPPFLAGS。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.