Wie behebe ich die Einbindung von Boost-Bibliotheken / Headern über autoconf / automake?

Ich bin neu in autom4te und versuche, mit autoconf / automake ein C ++ - Programm auf mehreren Architekturen zu erstellen und zu verknüpfen. Die Verknüpfung wird durch die Tatsache erschwert, dass für das Projekt ein Boost erforderlich ist (Dateisystem, System, program_options).

Ich benutze boost.m4 (vonhttp://github.com/tsuna/boost.m4/tree/), und es scheint, alle Bibliotheken und Header erfolgreich zu finden.

Leider schlägt die Verknüpfung immer noch fehl und ich bin verwirrt.

Dies sind die relevanten Zeilen vonconfigure.ac:

AC_CONFIG_MACRO_DIR([m4])
# ...
AC_PROG_CXX
AC_PROG_LIBTOOL
# ...
BOOST_REQUIRE([1.41.0])
BOOST_FILESYSTEM
BOOST_SYSTEM
BOOST_PROGRAM_OPTIONS
# ...

Und insrc/Makefile.am:

bin_PROGRAMS = phenomatrix
phenomatrix_CXXFLAGS = $(BOOST_CPPFLAGS)
phenomatrix_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LDFLAGS) # $(BOOST_SYSTEM_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB)
phenomatrix_LIBS = $(BOOST_SYSTEM_LIBS) $(BOOST_FILESYSTEM_LIBS) $(BOOST_PROGRAM_OPTIONS_LIBS)
phenomatrix_SOURCES = adjacency_list.cpp distance.cpp genephene.cpp knearest.cpp marshall.cpp oracle.cpp type_shield.cpp avgmindist.cpp euclidean.cpp hypergeometric.cpp main.cpp mindist.cpp partialbayes.cpp utilities.cpp

Diese geben keine Fehler und es gelingt sogar, die Bibliotheken und Header zu finden:

checking for Boost headers version >= 104100... yes
checking for Boost's header version... 1_41
checking for the toolset name used by Boost for g++... gcc44 -gcc
checking boost/system/error_code.hpp usability... yes
checking boost/system/error_code.hpp presence... yes
checking for boost/system/error_code.hpp... yes
checking for the Boost system library... yes
checking boost/filesystem/path.hpp usability... yes
checking boost/filesystem/path.hpp presence... yes
checking for boost/filesystem/path.hpp... yes
checking for the Boo,st filesystem library... yes
checking for boost/system/error_code.hpp... (cached) yes
checking for the Boost system library... (cached) yes
checking boost/program_options.hpp usability... yes
checking boost/program_options.hpp presence... yes
checking for boost/program_options.hpp... yes
checking for the Boost program_options library... yes

Aber dann, wenn ich rennemakeIch erhalte Fehler:

libtool: link: g++ -g -O2 -o phenomatrix phenomatrix-adjacency_list.o phenomatrix-distance.o phenomatrix-genephene.o phenomatrix-knearest.o phenomatrix-marshall.o phenomatrix-oracle.o phenomatrix-type_shield.o phenomatrix-avgmindist.o phenomatrix-euclidean.o phenomatrix-hypergeometric.o phenomatrix-main.o phenomatrix-mindist.o phenomatrix-partialbayes.o phenomatrix-utilities.o  -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
phenomatrix-adjacency_list.o: In function `__static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:208: undefined reference to `boost::system::get_system_category()'
/usr/local/include/boost/system/error_code.hpp:209: undefined reference to `boost::system::get_generic_category()'
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::get_generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::get_generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::get_system_category()'

die ad nauseum wiederholen.

Ich bin mir nicht mal sicher, wie ich testen soll, ob es die richtigen Verzeichnisse enthält. Ja, ich verstehe, dass es eine gibt-t flag auf g ++, aber ich weiß nicht genau, wie ich das weitergeben soll (aus autom4te heraus).

Ich stelle fest, dass dies mit mehreren Versionen der Boost-Bibliotheken und -Header auf demselben Computer zu tun hat, und ich kann nicht viel dagegen tun.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage