X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=1.8 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Message-ID: <30930187.post@talk.nabble.com> Date: Tue, 15 Feb 2011 03:57:54 -0800 (PST) From: lampak To: cygwin AT cygwin DOT com Subject: [g++] Problems linking boost.system and boost.regex MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 > >::assign(char const*, char const*, unsigned int)]+0x22): undefined reference to `boost::basic_regex > >::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, std::allocator > >, std::allocator, std::allocator > > > >, boost::regex_traits > >::perl_matcher(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, boost::match_results<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > > >&, boost::basic_regex > > const&, boost::regex_Oscar::_match_flags, __gnu_cxx::__normal_iterator, std::allocator > >)]+0xd0): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > >, boost::regex_traits > >::construct_init(boost::basic_regex > > 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, std::allocator > >, std::allocator, std::allocator > > > >, char, boost::regex_traits > >(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, boost::match_results<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > > >&, boost::basic_regex > > const&, boost::regex_Oscar::_match_flags, __gnu_cxx::__normal_iterator, std::allocator > >)]+0x72): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator > >, std::allocator, std::allocator > > > >, boost::regex_traits > >::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