undefined reference to boost::detail::graph::read_graphviz

classic Classic list List threaded Threaded
3 messages Options
ijs
Reply | Threaded
Open this post in threaded view
|

undefined reference to boost::detail::graph::read_graphviz

ijs
Hi,

I have a problem with the Boost Graph Library: I'm unable to link with
the read_graphviz function.  I'm using Boost v. 1.33.1 on Fedora Core
3, Linux 2.6.10, gcc 3.4.4. I try to compile the example
boost_1_33_1/libs/graph/example/graphviz.cpp.

 > g++ -I /usr/local/include/boost-1_33_1/
/home/ijs/boost_1_33_1/libs/graph/src/libbgl-viz.a graphviz.cpp
/tmp/ccBWKH7i.o(.gnu.linkonce.t._ZN5boost13read_graphvizINS_14adjacency_listINS_4vecSES2_NS_11undirectedSENS_8propertyINS_13vertex_name_tESsNS_11no_propertyEEENS4_INS_13edge_weight_tEdS6_EES6_NS_5listSEEEEEbRSiRT_RNS_18dynamic_propertiesERKSs+0x6e):
In function `bool
boost::read_graphviz<boost::adjacency_list<boost::vecS, boost::vecS,
boost::undirectedS, boost::property<boost::vertex_name_t,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
 >, boost::no_property>, boost::property<boost::edge_weight_t, double,
boost::no_property>, boost::no_property, boost::listS>
 >(std::basic_istream<char, std::char_traits<char> >&,
boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
boost::property<boost::vertex_name_t, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, boost::no_property>,
boost::property<boost::edge_weight_t, double, boost::no_property>,
boost::no_property, boost::listS>&, boost::dynamic_properties&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&)':
: undefined reference to
`boost::detail::graph::read_graphviz(std::basic_istream<char,
std::char_traits<char> >&, boost::detail::graph::mutate_graph&)'
collect2: ld returned 1 exit status

I would appreciate any advice. Thanks for reading.


Best,
Irek
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to boost::detail::graph::read_graphviz

Johan Oudinet
On 4/12/06, Irek Szczesniak <[hidden email]> wrote:
> I have a problem with the Boost Graph Library: I'm unable to link with
> the read_graphviz function.  I'm using Boost v. 1.33.1 on Fedora Core
> 3, Linux 2.6.10, gcc 3.4.4. I try to compile the example
> boost_1_33_1/libs/graph/example/graphviz.cpp.

- Get the BGL sources
- Build the libbgl-viz.a library (follow the instruction here:
http://www.cs.brown.edu/~jwicks/boost/libs/graph/doc/read-graphviz.html)
- Compile with this library (g++ your_source.cpp
-Lpath/to/your/library -lbgl-viz)

>
>  > g++ -I /usr/local/include/boost-1_33_1/
> /home/ijs/boost_1_33_1/libs/graph/src/libbgl-viz.a graphviz.cpp
> > : undefined reference to
> `boost::detail::graph::read_graphviz(std::basic_istream<char,
> std::char_traits<char> >&, boost::detail::graph::mutate_graph&)'
> collect2: ld returned 1 exit status
>
> I would appreciate any advice. Thanks for reading.
>

Regards,

--
Johan
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
ijs
Reply | Threaded
Open this post in threaded view
|

Re: undefined reference to boost::detail::graph::read_graphviz

ijs
Thank you for your email, Johan.  I resolved the issue, but the
solution was different than the one you pointed out.  It seems there
is a bug in boost_1_33_1/libs/graph/src/Makefile.

 >>I have a problem with the Boost Graph Library: I'm unable to link
 >>with the read_graphviz function.  I'm using Boost v. 1.33.1 on
 >>Fedora Core 3, Linux 2.6.10, gcc 3.4.4. I try to compile the example
 >>boost_1_33_1/libs/graph/example/graphviz.cpp.
 >
 > - Get the BGL sources
 > - Build the libbgl-viz.a library (follow the instruction here:
 >
http://www.cs.brown.edu/~jwicks/boost/libs/graph/doc/read-graphviz.html)
 > - Compile with this library (g++ your_source.cpp
 > -Lpath/to/your/library -lbgl-viz)

Yes, I did all this: got newest Boost, compiled the non-header files
of BGL and linked graphviz.cpp with the bgl-viz library.  I followed
the instructions at:

http://www.boost.org/libs/graph/doc/read_graphviz.html

I built the bgl-viz lib in two ways:
1. went to boost_1_33_1/libs/graph/src and typed: make
2. went to boost_1_33_1/libs/graph/build and typed: bjam "-sTOOLS=gcc"

When trying to link with the bgl-viz lib, I got the same error:
undefined reference to
`boost::detail::graph::read_graphviz(std::basic_istream<char,
std::char_traits<char> >&, boost::detail::graph::mutate_graph&)'

After some more work I realized that file
boost_1_33_1/libs/graph/src/read_graphviz_spirit.cpp is missing at
boost_1_33_1/libs/graph/src/Makefile:35.  After I added it and
recompiled the bgl-viz library, the example worked fine.


Best,
Irek
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users