Mail Archives: djgpp/2003/01/09/18:17:44
Roger Dahl <rdnews AT dahlsys DOT com> wrote:
: I'm trying to use the Regex++ part of the Boost library. The library
: compiles without any problems, but I get linker errors when I try to
: use it. Here's my test app:
: #include <boost/regex.hpp>
: int main() {
: boost::regex r("test");
: return 0;
: }
: When I try to link with the library, I get the following errors:
:>gpp.exe -O2 -Wall -L/djgpp/boost_1_29_0/libs/regex/build/gcc
: -lboost_regex -I/djgpp/boost_1_29_0 -o mapper.exe mapper.cpp
: d:/tmp/cc8e650b.o(.text+0x2d):mapper.cpp: undefined reference to
: `boost::reg_expression<char, boost::regex_traits<char>,
: std::allocator<char> >::reg_expression[in-charge](char const*,
: unsigned, std::allocator<char> const&)'
: d:/tmp/cc8e650b.o(.text+0x35):mapper.cpp: undefined reference to
: `boost::reg_expression<char, boost::regex_traits<char>,
: std::allocator<char> >::~reg_expression [in-charge]()'
: Listing the symbols in my test app with nm, I can find undefined
: symbols like this one:
:
: U boost::reg_expression<char,
: boost::regex_traits<char>,std::allocator<char> >::~reg_expression()
:
: Listing the symbols in the library, I can find the same symbols again,
: but defined:
:
: T boost::reg_expression<char,
: boost::regex_traits<char>,std::allocator<char> >::~reg_expression()
Link order. Put your libraries _last_.
Right,
MartinS
- Raw text -