我的automake构建用于构建正常,但不是因为我对我的gentoo框进行了大量更新,它更新了binutils。我现在正在运行binutils-2.23.2。
共享库正在构建,但是当需要链接程序时,链接器找不到libs,但是,这些库确实存在于每个库目录的.libs目录中并添加到_LDADD路径在_LDFLAGS中。
这里是编译输出直到错误:
...
/bin/sh ../../../libtool --tag=CXX --mode=link g++ -std=gnu++0x -L/usr/lib64 -L/usr/local/lib64 -L/usr/local/lib -L/home/srd/ODDS/ACE_wrappers/lib -L/home/srd/ODDS/DDS/lib -L/home/srd/ODDS/DDS/dds/DCPS -L/home/srd/staging/test-BUILD/src/libs/conidl -L/home/srd/staging/test-BUILD/src/libs/common -o econ econ-listener.o econ-main.o -lboost_program_options -lOpenDDS_Tcp -lOpenDDS_InfoRepoDiscovery -lOpenDDS_Dcps -lTAO_PortableServer -lTAO_AnyTypeCode -lTAO -lACE -lboost_thread -lrt -lboost_system -lpthread -leconf -lecommons
libtool: link: g++ -std=gnu++0x -o econ econ-listener.o econ-main.o -L/usr/lib64 -L/usr/local/lib64 -L/usr/local/lib -L/home/srd/ODDS/ACE_wrappers/lib -L/home/srd/ODDS/DDS/lib -L/home/srd/ODDS/DDS/dds/DCPS -L/home/srd/staging/test-BUILD/src/libs/conidl -L/home/srd/staging/test-BUILD/src/libs/common -lboost_program_options -lOpenDDS_Tcp -lOpenDDS_InfoRepoDiscovery -lOpenDDS_Dcps -lTAO_PortableServer -lTAO_AnyTypeCode -lTAO -lACE -lboost_thread -lrt -lboost_system -lpthread -leconf -lecommons
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld:
cannot find -leconf
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld:
cannot find -lecommons
collect2: error: ld returned 1 exit status
make[4]: *** [econ] Error 1
我已尝试多次以不同的顺序将这两个库添加到_LDADD,但除了错误的排序之外,它没有任何区别。该程序的Makefile.am是:
include $(top_srcdir)/common.am
bin_PROGRAMS = econ
econ_SOURCES = listener.cpp main.cpp
econ_CPPFLAGS = -I$(top_srcdir)/src/includes -I/usr/include/boost -I/usr/local/include -I$(ACE_INCL) -I$(DDS_HOME) -I$(TAO_INCL) -I$(TAO_INCL)/orbsvcs -I$(top_srcdir)/src/libs/conidl
econ_LDFLAGS = -L/usr/lib64 -L/usr/local/lib64 -L/usr/local/lib -L$(ACE_LIBS) -L$(DDS_LIBS) -L$(DCPS_LIBS) -L$(E_LIBS)/conidl -L$(E_LIBS)/common
econ_LDADD = -lboost_program_options -lOpenDDS_Tcp -lOpenDDS_InfoRepoDiscovery -lOpenDDS_Dcps -lTAO_PortableServer -lTAO_AnyTypeCode -lTAO -lACE -lboost_thread -lrt -lboost_system -lpthread -leconf -lecommons
Makefile.am中包含的common.am如下所示:
E_HOME = /home/srd/staging/test-BUILD
E_LIBS = $(E_HOME)/src/libs
任何帮助都非常感激。