编译器找不到libxml / parser.h [英] Compiler can't find libxml/parser.h

查看:1414
本文介绍了编译器找不到libxml / parser.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Debian 8(Jessie),64位。我安装了 libxml2-dev ,它现在位于 / usr / include / libxml2 / libxml 中。



但是当我做(就像 libxml docs说)

  #include   

只有编译时才能得到(使用 gcc

 致命错误:libxml / parser.h:没有这样的文件或目录

注意:在另一台机器上,使用旧的64位Suse,其中 libxml2-dev 位于完全相同的路径,没有其他环境变量设置相比,新的Debian,它的工作是完美的。使用完全相同的makefile从一个计算机迁移到另一台计算机时出现问题。 所有其他 -dev 我需要的libs(与他们记录的 #include< path> )(它们都安装在 apt-get )中,只有 libxml2-dev 不是



我需要做其他任何事情才能使 libxml2-dev 可见吗?

解决方案

尝试使用 parser.h 文件的显式包含来编译,即smth像这样



g ++ -I / usr / include / libxml2 /






以下环境变量也可用于查找头文件

  CPATH 
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH

查找更多信息此处


I am on Debian 8 (Jessie), 64 Bit. I installed libxml2-dev, which now sits in /usr/include/libxml2/libxml.

But when I do (just like libxml docs say)

#include <libxml/parser.h>

I only get when compiling (with gcc)

fatal error: libxml/parser.h: no such file or directory

Notes: On another machine, with an old 64 Bit Suse, where libxml2-dev sits in the exact same path and no other environment vars are set compared to the new Debian, it works perfectly fine. Problem occured while migrating from one to another computer using the exact same makefiles. All other -dev libs that I need just worked (with their documented #include <path>) after the migration (they were all installed with apt-get), only libxml2-dev is not found on compilation.

Do I need to do anything else to make libxml2-dev visible?

解决方案

Try to compile with explicite inclusion where the parser.h file is, i.e. smth like this

g++ -I/usr/include/libxml2/


Following environment variables can also be used for lookup of header files

CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH

Find more information here

这篇关于编译器找不到libxml / parser.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆