glib.h 出错。致命错误:glib.h:没有那个文件或目录

Har*_*thi 8 compiling glib make

对于我在互联网上搜索的解决方案。我添加的命令的输出
pkg-config --cflags glib-2.0-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include到像生成文件 GCC = -I的/ usr /包括/油嘴-2.0 -I / usr / lib中/ I386-Linux的GNU /油嘴-2.0 /包括-lglib-2.0

but still an error glib.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

这是我的制作文件

ROOTDIR = $(CURDIR)
#-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include  include makefiles/platforms.mk

ZLIBDIRS = zlibrary/core zlibrary/text zlibrary/ui APPDIRS = fbreader  GCC = -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include  -lglib-2.0
#gcc -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include
#gcc pkg-config --cflags --libs glib-2.0  all:  @for dir in $(ZLIBDIRS) $(APPDIRS); do \        if [ -d $$dir ]; then \             cd $$dir; \             if ! $(MAKE); then \
                exit 1; \           fi; \           cd $(ROOTDIR); \        fi; \   done;

install: all do_install

do_install:     @for dir in $(ZLIBDIRS) $(APPDIRS); do \        if [ -d $$dir ]; then \             cd $$dir; make $@; cd $(ROOTDIR); \         fi; \   done

do_install_dev:     @for dir in $(ZLIBDIRS); do \       if [ -d $$dir ]; then \             cd $$dir; make $@; cd $(ROOTDIR); \         fi; \   done

clean:  @for dir in $(ZLIBDIRS) $(APPDIRS); do \        if [ -d $$dir ]; then \             cd $$dir; make $@; cd $(ROOTDIR); \         fi; \   done

distclean: clean    @rm -rvf *.tgz *.tar.gz *.ipk *.deb *.prc *.exe
*.log *.dsc *.changes *.rpm     @rm -rf tmp packages packages-nonGPL fbreader-*
Run Code Online (Sandbox Code Playgroud)

请让我摆脱这个。提前致谢。

Syl*_*eau 8

您可能只需要包含glib.h以下内容的 -dev 包:libglib2.0-dev

sudo apt-get install libglib2.0-dev
Run Code Online (Sandbox Code Playgroud)

http://packages.ubuntu.com及其搜索包内容表单可以帮助您在只知道头文件名的情况下找到此类开发包。

  • 从命令行查找:`apt-file find /glib.h` (2认同)