Boost logo

Boost Users :

Subject: Re: [Boost-users] Project link error with Wave on OSX
From: Olivier Prat (o.prat_at_[hidden])
Date: 2014-02-26 04:21:05


Le 25/02/2014 18:52, Hartmut Kaiser a écrit :>
> The wave libraries contain code for pre-instantiated templates only.
If you
> instantiate the templates yourself you will not need to link with the
> libraries.

Yes that seems logical. I've removed the library from the linker and
tried to explicitely instantiate the problematic templates in my cpp
file. Either I am not using the right syntax or something else is going
on, but this has had no effect whatsoever.

For instance, the first linker error is an undefined symbol for:

boost::wave::cpplexer::new_lexer_gen<__gnu_cxx::__normal_iterator<char*,
std::string>,
boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char,
std::allocator<char> >, char*> > >,
boost::wave::cpplexer::lex_token<boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char,
std::allocator<char> >, char*> > > >
>::new_lexer(__gnu_cxx::__normal_iterator<char*, std::string> const&,
__gnu_cxx::__normal_iterator<char*, std::string> const&,
boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char,
std::allocator<char> >, char*> > > const&, boost::wave::language_support)

So I tried to explicitly instantiate the template, the whole
new_lexer_gen struct, for instance (even though implicite instantiation
should work...) by typing:

template struct
boost::wave::cpplexer::new_lexer_gen<__gnu_cxx::__normal_iterator<char*,
std::string>,
boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char,
std::allocator<char> >, char*> > >,
boost::wave::cpplexer::lex_token<boost::wave::util::file_position<boost::wave::util::flex_string<char,
std::char_traits<char>, std::allocator<char>,
boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char,
std::allocator<char> >, char*> > > > >;

I'm pretty sure this is the right syntax, and that doesn't really give
an explanation on why this specific implicit instantiation doesn't work
(I'm also using other boost templates in this project with success,
tokenizer for instance). Something tells me this has something do to
with my project configuration but it's hard to see where.

>
> Also, do the examples/the wave driver tool compile and link properly?
>

Hmmm, I'll have to take some time to do that as the boost libraries have
been download "prebuild" from a packaging system. Anyway this was my
task of the morning, take some time to do my own custom build of boost
and see if that fixes the issue.
Thanks for your time.


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