Ok I'm using Bloodshed Dev-C++, but im also fine using vc++ 6.0. I downloaded the latest boost - boost_1_34_1.7z, and moved the boost folder into the include folder for devc++ and vc++, but when I try to compile something that uses boost regex I get too many errors. Someone help me?
When I compile this example I got from somewhere I get this.
in vc++ I get 40 errors, so I'll just paste the first two:Code:#include <iostream> #include <string> #include <boost/regex.hpp> // Boost.Regex lib using namespace std; int main( ) { std::string s, sre; boost::regex re; while(true) { cout << "Expression: "; cin >> sre; if (sre == "quit") { break; } cout << "String: "; cin >> s; try { // Set up the regular expression for case-insensitivity re.assign(sre, boost::regex_constants::icase); } catch (boost::regex_error& e) { cout << sre << " is not a valid regular expression: \"" << e.what() << "\"" << endl; continue; } if (boost::regex_match(s, re)) { cout << re << " matches " << s << endl; } } return 0; }
in devc++:d:\program files\microsoft visual studio\vc98\include\utility(123) : warning C4786: 'std::_Tree<int,std:air<int const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::map<int,std::basic_string<char,std::char_traits<char
>,std::allocator<char> >,std::less<int>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Kfn,std::less<int>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<c har> > > >::_Nil' : ide
ntifier was truncated to '255' characters in the debug information
d:\program files\microsoft visual studio\vc98\include\utility(123) : warning C4786: 'std::iterator<std::bidirectional_iterator_tag,std:air<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > const ,st
d::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > >,int>' : identifier was truncated to '255' characters in the debug information
d:\program files\microsoft visual studio\vc98\include\utility(123) : warning C4786: 'std::unary_function<std:air<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > const ,std::basic_string<unsigned s
hort,std::char_traits<unsigned short>,std::allocator<unsigned short> > >,std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > >' : identifier was truncated to '255' characters in the debug information
40:2 D:\Program Files\Microsoft Visual Studio\MyProjects\Aah\Aahs.cpp [Warning] no newline at end of file
[Linker error] undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
[Linker error] undefined reference to `boost::re_detail:erl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
[Linker error] undefined reference to `boost::re_detail:erl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
40:2 D:\Program Files\Microsoft Visual Studio\MyProjects\Aah\Aahs.cpp ld returned 1 exit status




air<int const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::map<int,std::basic_string<char,std::char_traits<char
Reply With Quote