Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/140.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Makefile中指定库路径 我使用AutoCONF和AutoMead作为C++项目,我希望G++在我的源代码已经有时能够足够地查看 /Ur/Is/代码> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> #include <libxml/parser.h> #include <libxml/tree.h> #include <curl/curl.h> #include <openssl/md5.h>_C++_Gcc_G++_Autoconf_Automake - Fatal编程技术网

在Makefile中指定库路径 我使用AutoCONF和AutoMead作为C++项目,我希望G++在我的源代码已经有时能够足够地查看 /Ur/Is/代码> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> #include <libxml/parser.h> #include <libxml/tree.h> #include <curl/curl.h> #include <openssl/md5.h>

在Makefile中指定库路径 我使用AutoCONF和AutoMead作为C++项目,我希望G++在我的源代码已经有时能够足够地查看 /Ur/Is/代码> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> #include <libxml/parser.h> #include <libxml/tree.h> #include <curl/curl.h> #include <openssl/md5.h>,c++,gcc,g++,autoconf,automake,C++,Gcc,G++,Autoconf,Automake,我必须以这种方式使用CCXXFLAGS包含库路径 $ CXXFLAGS=-I/usr/include/libxml2 ./configure && make 有没有更好的方法来编写我的代码、Makefile或autoconf文件,以便g++能够在我的Makefile中的/usr/include/?中正确查找库。我是否有以下行来添加g++参数: AM_CPPFLAGS = -I$(top_srcdir)/src/include/ --std=c++0x 我认为你需要这样的东西:

我必须以这种方式使用
CCXXFLAGS
包含库路径

$ CXXFLAGS=-I/usr/include/libxml2 ./configure && make

有没有更好的方法来编写我的代码、Makefile或autoconf文件,以便g++能够在我的Makefile中的
/usr/include/

中正确查找库。我是否有以下行来添加g++参数:

AM_CPPFLAGS = -I$(top_srcdir)/src/include/ --std=c++0x
我认为你需要这样的东西:

AM_CPPFLAGS = `pkg-config --cflags libxml-2.0`

因此,您也不必担心其他系统上的include位于何处。

我使用了CXXFLAGS,它似乎可以工作。前缀AM_u代表什么?例如:cxflags=-I/usr/include/libxml2./configureI我不知道这是否是个好主意。如果我想构建您的应用程序,我需要知道我必须以这种方式设置CXXFLAGS。AM_CPPFLAGS是Makefile.AM中的一个变量。如果你把它放在那里,以后就没人会烦了。不!不不如果要使用
pkg config
,请使用
pkg\u CHECK\u MODULES
,但不要这样做。(见附件)。如果用户在非标准位置安装库,则用户有责任告知编译器,并且用户应在配置时设置
cppfagas
。软件包维护人员不负责为用户执行基本的系统管理工作。这些不是
g++
的参数。这些是预处理器的参数。请记住,用户可能正在使用任何编译器和任何预处理器,您不能假设
g++
,或
gcc
,或
cpp
,或您熟悉的任何工具。有一种更好的方法:
/configure CPPFLAGS=-I/usr/include/libxml2&&make
。(假设您使用的autoconf版本并不古老)
AM_CPPFLAGS = `pkg-config --cflags libxml-2.0`