2010-03-05 7 views
5

J'utilise autoconf pour détecter les bibliothèques Boost, avec le soutien du autoconf-archive macros et ils fonctionnent très bien avec les bibliothèques de stimuler le système à l'échelle, mais échouer si je compile manuellement coup de pouce dans mon répertoire:Pourquoi autoconf ne détecte pas correctement boost?

[email protected]:~/devel/spectra2$ ./configure --with-boost=/home/sb/local/ 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /bin/mkdir -p 
checking for gawk... no 
checking for mawk... mawk 
checking whether make sets $(MAKE)... yes 
checking build system type... i686-pc-linux-gnu 
checking host system type... i686-pc-linux-gnu 
checking for style of include used by make... GNU 
checking for gcc... gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking dependency style of gcc... gcc3 
checking for library containing strerror... none required 
checking for g++... g++ 
checking whether we are using the GNU C++ compiler... yes 
checking whether g++ accepts -g... yes 
checking dependency style of g++... gcc3 
checking for boostlib >= 1.31.0... yes 
checking whether the Boost::Program_Options library is available... yes 
checking for exit in -lboost_program_options... yes 
checking whether the Boost::Filesystem library is available... yes 
checking for exit in -lboost_filesystem... no 
checking for exit in -lboost_filesystem... (cached) no 
checking for exit in -lboost_filesystem... (cached) no 
configure: error: Could not link against boost_filesystem ! 

Comme vous pouvez voyez, il détecte certaines bibliothèques, mais il échoue avec boost-filesystem. Ce sont les contenus de ~/local/lib:

[email protected]:~$ ls -1 /home/sb/local/lib/ 
libboost_filesystem.a 
libboost_filesystem.so 
libboost_filesystem.so.1.42.0 
libboost_program_options.a 
libboost_program_options.so 
libboost_program_options.so.1.42.0 
libboost_system.a 
libboost_system.so 
libboost_system.so.1.42.0 
libboost_thread.a 
libboost_thread.so 
libboost_thread.so.1.42.0 

Donc la bibliothèque est là. J'ai essayé avec boost-1.39 et boost-1.42 sans résultat différent, aucune idée pourquoi cela se passe-t-il? Ai-je oublié quelque chose?

Répondre

3

Depuis boost 1,39 libboost_filesystem dépend libboost_system. Avant 1.39, vous pouviez seulement lier à boost_filesystem, dans les versions ultérieures vous devez lier les deux.

Peut-être qu'il a quelque chose à voir avec votre erreur.

+0

Votre supposition est juste: boost-système est installé et il y a un chèque dans le configure.ac, mais ce fut après la vérification de boost système de fichiers. Si je change de commande, tout fonctionne comme prévu. Ceci est également un petit problème de documentation autoconf-archive – Kjir

+1

@Dmitry Yudakov S'il vous plaît fournir un lien/référence pour votre déclaration. – Qsiris

1

J'ai trouvé boost.m4 beaucoup plus robuste que les macros Boost disponibles à partir de l'archive Macro Autoconf. Vous pouvez avoir de la chance en migrant simplement vers boost.m4.

Questions connexes