Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] adjacency_list.hpp requires to link with serialization lib in 1.44?
From: Stefan van Kessel (van_kessel_at_[hidden])
Date: 2010-08-18 22:12:10


On 8/18/2010 3:09 PM, Oliver Koenig wrote:
> Hello,
> when trying to update Boost from 1.43 to 1.44 in our code we noticed
> that in 1.44 we need to link to the serialization lib as soon as
> boost/graph/adjacency_list.hpp is included.
> Is this correct behavior or is this a bug?
>
> To reproduce this it is sufficient to build the following test program
> hello_adjacency_list.cpp (tested with MSVC-9.0):
>
> #include <iostream>
> #include <boost/graph/adjacency_list.hpp>
>
> int main(){
>
> std::cout << "hello adjacency_list\n";
>
> return 0;
> }
>
> With the boost build rule
> "exe hello_adjacency_list : hello_adjacency_list.cpp ;"
> compilation fails with:
> compile-c-c++
> ..\..\..\bin\even_utils\test\graph\msvc-9.0\release\address-model-64\threading-multi\hello_adjacency_list.obj
>
> hello_adjacency_list.cpp
> msvc.link
> ..\..\..\bin\even_utils\test\graph\msvc-9.0\release\address-model-64\threading-multi\hello_adjacency_list.exe
>
> LINK : fatal error LNK1104: cannot open file
> 'libboost_serialization-vc90-mt-1_44.lib'
>
> Using the build rule
> "exe hello_adjacency_list : hello_adjacency_list.cpp
> /boost//serialization
> : <link>shared<define>BOOST_SERIALIZATION_DYN_LINK ;"
> everything works fine.
>
> Sincerely
> ok
>

Hello,

I can reproduce your problem. I think the problem is the addition of
#include <boost/archive/basic_archive.hpp>
within boost\serialization\serialization.hpp which pulls in auto
linking. Simply commenting out that include stops the automatic linking
but will most likely break some other code.

Partial output from svn diff:
===================================================================
--- serialization.hpp (.../Boost_1_44_0/boost/serialization) (revision
64907)
+++ serialization.hpp (.../Boost_1_43_0/boost/serialization) (revision
64907)
@@ -11,10 +11,14 @@
  #endif

  #include <boost/config.hpp>
-#include <boost/archive/basic_archive.hpp>

Partial output from cl /showIncludes:
Note: including file: D:\src\boost_1_44_0\boost/graph/named_graph.hpp
Note: including file:
D:\src\boost_1_44_0\boost/multi_index/detail/archive_constructed.hpp
Note: including file:
D:\src\boost_1_44_0\boost/serialization/serialization.hpp
Note: including file:
D:\src\boost_1_44_0\boost/archive/basic_archive.hpp
Note: including file:
D:\src\boost_1_44_0\boost/archive/detail/auto_link_archive.hpp
Note: including file: D:\src\boost_1_44_0\boost/config/auto_link.hpp

Have a nice day,
Stefan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net