libxml/parser.h: in c++ ubuntu
libxml/parser.h: in c++ ubuntu
即使我已经在我的 ubuntu 12.04 版本中安装了 libxml++2.6-2 libxml++2.6-doc 等,我仍然收到以下错误 致命错误:libxml/parser.h:没有这样的文件或目录我正在使用 make 来构建项目
Kindly suggest any other libxml libraries which I need to install
-
libxml/parser.h
是libxml
库的一部分,而不是libxml++
-
对于任何给定的库,您需要开发包(名称以
-dev
结尾的包(才能使用该库构建应用程序。 -
您需要将其他标志传递给编译器:
xml2-config --cflags
和链接器xml2-config --libs
。
我现在无法访问 Ubuntu 系统,但是: 也许您需要安装 libxml 开发人员包?也许您只有库但没有包含文件?
入住/usr/include
, /usr/local/include
, ...对于目录libxml
和文件parser.h
。
如果找到该文件,则可能需要调整makefile,以便父目录位于包含路径列表中,例如:
INC = -I/usr/local/include
g++ $(INC) ...
如果未找到该文件:请检查开发人员软件包的可用 libxml 软件包并安装该文件。
在发布答案之前 感谢回答的人,但这些答案对我不起作用
I have just copied libxml folder from the directory usr/lib/libxml2 and pasted in usr/lib directory and compiled my code it is not giving any error. It is working fine now.
在阅读本文之前,请阅读@el.pescado 答案。我想评论这个答案,但觉得有必要更好地格式化我的代码。
gcc -c <files to compile> `xml2-config --cflags` -o <object files>
gcc <object files> -L<libxml2 lib location> `xml2-config --libs` -o <binary file>
假设我们有一个文件名xmltest.c
其代码包含libxml2
标头,如#include <libxml/parser.h>
,共享库的标准位置libxml2
即 /usr/lib64/libxml2
,上面的代码将像这样计算:
gcc -c xmltest.c -I/usr/include/libxml2 -o xmltest.o
gcc xmltest.o -L/usr/lib64/libxml2 -lxml2 -lz -lm -o xmltest
更好的主意是将自动执行此操作的Makefile
放在一起。
- netcat command in c++
- Difference in displaying cv2 Mat
- C++ MFC Libraries in Travis CI
- 如何在OpenSSL中从configuration.h.in获取configuration.h
- 创建具有 new in 函数和"this is nullptr"异常的对象
- IN, OUT, INOUT Parameters
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 有人安装"IITB Simplecpp in mac"吗?
- 从 C 样式字符串中删除子字符串 "in place" 在C++代码中
- 如何修复"error: ‘_1’ was not declared in this scope"?
- Softmax Implementation in C++
- 将 out/in out 参数与 if/switch 的 init 语句一起使用
- IF-nesting in c++
- Gurobi GRBModel and GRBmodel in C++
- Tensorflow Hub in C++
- Centos7 g++ "to_string is not in a member of std"
- InitializeCriticalSectionEx Not Located In KERNEL32.Dll
- 将 lambda 表达式传递给 std::function in C++
- @CPPFLAGS@在 Makefile.in 中意味着什么?
- std::async from std::async in windows xp