【发布时间】:2017-09-28 19:52:01
【问题描述】:
使用autoconf工具时,包相关的M4宏由AC_INIT定义并存储在config.h中,其中一些如下:
PACKAGEPACKAGE_NAMEPACKAGE_TARNAMEPACKAGE_VERSIONPACKAGE_STRING
我的大部分库包含文件都使用此config.h 文件,该文件存储在其自己安装的包含子目录中(即/usr/include/mylib)。
进入我的应用程序,它使用同一个库的包含文件。
此外,这个应用程序有自己的configure.ac/AC_INIT,反过来,它也会在本地生成自己的config.h。
在编译时,我收到以下警告消息:
In file include from app.cpp:3:0:
config.h:427:0 warning: "PACKAGE_VERSION" redefined
#define PACKAGE_VERSION "1.2"
^
In file included from <command-line>:0:0:
/usr/include/mylib/config.h:535:0: note: this is the location of the previous definition
#define PACKAGE_VERSION "4.0"
处理多个AC_INIT 生成的PACKAGE 宏组冲突的最佳方法是什么?
【问题讨论】: