CFLAGS并分配多个引用? 我不习惯用C或C++工作,我想让编译器在哪里找到引用丢失。

CFLAGS并分配多个引用? 我不习惯用C或C++工作,我想让编译器在哪里找到引用丢失。,c++,c,makefile,C++,C,Makefile,我有一个名为configure的配置文件,它创建了makefile 然后,要创建我运行的makefile: CFLAGS=-I/usr/include/libxml2 ./configure --enable-murder 当我运行这一行时,在CFLAGS?中给出了两个引用 为了明确mais,我想指出参考文献: /usr/include/libxml2 /usr/include/libical 在CFLAGS中 这是因为我无法编辑makefile,我想修复以下错误: http_calda

我有一个名为configure的配置文件,它创建了makefile

然后,要创建我运行的makefile:

CFLAGS=-I/usr/include/libxml2 ./configure  --enable-murder
当我运行这一行时,在CFLAGS?中给出了两个引用

为了明确mais,我想指出参考文献:

  • /usr/include/libxml2
  • /usr/include/libical
在CFLAGS中

这是因为我无法编辑makefile,我想修复以下错误:

http_caldav.o: In function `is_valid_timerange':
http_caldav.c:(.text+0x3c86): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3cd8): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3d2a): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3d7c): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3dce): undefined reference to `icaltime_is_utc'
http_caldav.c:(.text+0x3e23): undefined reference to `icaltime_is_utc'
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x3e7d): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3e98): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x3eb7): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f02): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f19): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f46): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f71): undefined reference to `xmlStrcmp'
http_caldav.o:http_caldav.c:(.text+0x3f9c): more undefined references to `xmlStrcmp' follow
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x4077): undefined reference to `xmlFree'
http_caldav.c:(.text+0x40cc): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x40d9): undefined reference to `icaltimezone_get_utc_timezone'
http_caldav.c:(.text+0x410f): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x412d): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4171): undefined reference to `xmlFree'
http_caldav.c:(.text+0x41a0): undefined reference to `icaltime_from_timet_with_zone'
http_caldav.c:(.text+0x41f2): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x4210): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4254): undefined reference to `xmlFree'
http_caldav.c:(.text+0x4283): undefined reference to `icaltime_from_timet_with_zone'
config.log

gcc-4.7.real: error: unrecognized command line option '-V'
gcc-4.7.real: fatal error: no input files
compilation terminated.
configure:3214: $? = 4
configure:3203: gcc -qversion >&5
gcc-4.7.real: error: unrecognized command line option '-qversion'
gcc-4.7.real: fatal error: no input files
compilation terminated.
conftest.c:13:28: fatal error: ac_nonexistent.h: No such file or directory
conftest.c:56:26: fatal error: minix/config.h: No such file or directory
conftest.c:37:9: error: unknown type name 'not'
conftest.c:37:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'universal'
conftest.c:37:15: error: unknown type name 'universal'
gcc-4.7.real: error: unrecognized option '-R'

我的操作系统是Debian 7。

如果要添加两个包含路径,请将它们括在引号中

CFLAGS="-I/usr/include/libxml2 -I/usr/include/libical" ./configure --enable-murder
要修复链接器错误,必须添加带有
LDLIBS
的库,例如

CFLAGS="..." LDLIBS="-lxml2 -lical" ./configure --enable-murder

如果要添加两个包含路径,请将它们括在引号中

CFLAGS="-I/usr/include/libxml2 -I/usr/include/libical" ./configure --enable-murder
要修复链接器错误,必须添加带有
LDLIBS
的库,例如

CFLAGS="..." LDLIBS="-lxml2 -lical" ./configure --enable-murder


是否要添加带有
CFLAGS
的两个包含路径?这是链接时间错误。向CFLAGS添加更多路径不会有帮助,因为它可能会找到头。您可能需要为这些库安装开发包以使它们链接。配置是否会抱怨缺少内容?@这很重要,
configure
(如果它是一个autoconf
configure
文件)会抱怨缺少内容,除非它没有对它们进行测试,在本例中,如果它可以链接库。@ldav1s我已经安装了开发包,但没有解决这些问题的参考。虽然我仍然没有解决。是否要添加两个带有
CFLAGS
的include路径?这些是链接时间错误。向CFLAGS添加更多路径不会有帮助,因为它可能会找到头。您可能需要为这些库安装开发包以使它们链接。配置是否会抱怨缺少内容?@这很重要,
configure
(如果它是一个autoconf
configure
文件)会抱怨缺少内容,除非它没有对它们进行测试,在本例中,如果它可以链接库。@ldav1s我已经安装了开发包,但没有解决这些问题的参考。虽然我仍然没有解决。通常最好将变量作为参数添加到
configure
脚本中,而不是添加到环境中。所以,
/configure--enable crime CFLAGS=“…”LDLIBS=“…”
@ldav1s现在试试这个,但我仍然无法修复它。很抱歉,不能与C或C++一起使用,我正在努力使其正常工作。我想学习并修复它。还有什么建议吗?@ldav1s我找到了一个config.log文件。创建此文件是为了运行文件configue。现在编辑问题,添加我在中看到的一些错误。@ldav1s我想我找到了解决方案!记下至少几个错误。不要使用ldlib,而是使用LDFLAGS。现在所有对我的引用都是sqlite3\u column\u int。@MariaJoséconfig.log代码段只是配置检查了一些东西。如果生成运行并且只有
sqlite3\u column\u int
作为未定义的引用,则必须将
-lsqlite3
添加到
LDLIBS
/
LDFLAGS
。当然,还要确保安装了SQLite。通常最好将变量作为参数添加到
configure
脚本中,而不是添加到环境中。所以,
/configure--enable crime CFLAGS=“…”LDLIBS=“…”
@ldav1s现在试试这个,但我仍然无法修复它。很抱歉,不能与C或C++一起使用,我正在努力使其正常工作。我想学习并修复它。还有什么建议吗?@ldav1s我找到了一个config.log文件。创建此文件是为了运行文件configue。现在编辑问题,添加我在中看到的一些错误。@ldav1s我想我找到了解决方案!记下至少几个错误。不要使用ldlib,而是使用LDFLAGS。现在所有对我的引用都是sqlite3\u column\u int。@MariaJoséconfig.log代码段只是配置检查了一些东西。如果生成运行并且只有
sqlite3\u column\u int
作为未定义的引用,则必须将
-lsqlite3
添加到
LDLIBS
/
LDFLAGS
。当然,还要确保安装了SQLite。