This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[g++] Problems linking boost.system and boost.regex


Hi. I'm trying to compile on windows one linux app of mine which uses a few
boost libraries. I've got g++ and boost (1.43.0-1) installed through
setup.exe. I use g++ through Eclipse IDE. I've managed to get the program
compiled but I'm getting linking errors. 

Eclipse executes the following command (I've shortened it a bit removing
other libraries than boost and changed the names of files):

g++ -o"result.exe"  ./Alice.o ./Bob.o ./Carol.o ./Dave.o ./Eve.o ./Fran.o
./Gordon.o ./Isaak.o ./Justin.o ./Mallory.o ./Oscar.o ./Peggy.o  
-lboost_regex-mt.dll -lboost_thread-mt.dll -lboost_date_time-mt.dll
-lboost_system-mt.dll

or, as another attempt without ".dll": (the result is exactly the same)
g++ -o"result.exe"  ./Alice.o ./Bob.o ./Carol.o ./Dave.o ./Eve.o ./Fran.o
./Gordon.o ./Isaak.o ./Justin.o ./Mallory.o ./Oscar.o ./Peggy.o
-lboost_regex-mt -lboost_thread-mt -lboost_date_time-mt -lboost_system-mt

or one more attempt, the same result again, with both ".dll" and without:
g++ -o"result.exe"  ./Alice.o ./Bob.o ./Carol.o ./Dave.o ./Eve.o ./Fran.o
./Gordon.o ./Isaak.o ./Justin.o ./Mallory.o ./Oscar.o ./Peggy.o  
-lboost_regex-mt.dll -lboost_thread-mt.dll -lboost_date_time-mt.dll
-lboost_system-mt.dll -lboost_regex-mt -lboost_thread-mt
-lboost_date_time-mt -lboost_system-mt

I don't get messages that libraries were not found which means they were. 

The errors related to boost.system are: 

/cygdrive/d/libs/include/boost/system/error_code.hpp:214: undefined
reference to `boost::system::generic_category()'
/cygdrive/d/libs/include/boost/system/error_code.hpp:215: undefined
reference to `boost::system::generic_category()'
/cygdrive/d/libs/include/boost/system/error_code.hpp:216: undefined
reference to `boost::system::system_category()'

(I don't actually use boost.system in my program, but from the errors I
guess I need to link it anyway)

Those suggesting something's wrong with regex are even more peculiar: 

./Fran.o:Fran.cpp:(.text$_ZN5boost11basic_regexIcNS_12regex_traitsIcNS_14c_regex_traitsIcEEEEE6assignEPKcS7_j[boost::basic_regex<char,
boost::regex_traits<char, boost::c_regex_traits<char> > >::assign(char
const*, char const*, unsigned int)]+0x22): undefined reference to
`boost::basic_regex<char, boost::regex_traits<char,
boost::c_regex_traits<char> > >::do_assign(char const*, char const*,
unsigned int)'
./Fran.o:Fran.cpp:(.text$_ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_14c_regex_traitsIcEEEEEC1ES6_S6_RNS_13match_resultsIS6_S9_EERKNS_11basic_regexIcSD_EENS_15regex_Oscar12_match_flagsES6_[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char
const*, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char
const*, std::basic_string<char, std::char_traits<char>, std::allocator<char>
> > > >, boost::regex_traits<char, boost::c_regex_traits<char> >
>::perl_matcher(__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
boost::match_results<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
>&, boost::basic_regex<char, boost::regex_traits<char,
boost::c_regex_traits<char> > > const&, boost::regex_Oscar::_match_flags,
__gnu_cxx::__normal_iterator<char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >)]+0xd0): undefined
reference to
`boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>, boost::regex_traits<char, boost::c_regex_traits<char> >
>::construct_init(boost::basic_regex<char, boost::regex_traits<char,
boost::c_regex_traits<char> > > const&, boost::regex_Oscar::_match_flags)'
./Fran.o:Fran.cpp:(.text$_ZN5boost12regex_searchIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEcNS_12regex_traitsIcNS_14c_regex_traitsIcEEEEEEbT_SD_RNS_13match_resultsISD_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_Oscar12_match_flagsESD_[bool
boost::regex_search<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>, char, boost::regex_traits<char, boost::c_regex_traits<char> >
>(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
boost::match_results<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >
>&, boost::basic_regex<char, boost::regex_traits<char,
boost::c_regex_traits<char> > > const&, boost::regex_Oscar::_match_flags,
__gnu_cxx::__normal_iterator<char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >)]+0x72): undefined
reference to
`boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
>, boost::regex_traits<char, boost::c_regex_traits<char> > >::find()'

Anyone knows what I'm doing wrong? 

(And BTW, what's the difference between libraries ending with .dll.a and .a
alone? And what does -mt stand for?)
-- 
View this message in context: http://old.nabble.com/-g%2B%2B--Problems-linking-boost.system-and-boost.regex-tp30930187p30930187.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]