I'm developing a small game using SDL and recently added a basic parser using boost regex to avoid hardcoding lots of statistical data... after I finally ironed out all the errors and none
of my code threw any errors CDT sudden spat out a pageful of errors involving the boost files themselves. I, or anyone I have talked to have been at a loss to describe what exactly is going
on never mind how to fix it...
The errors...
Code:
Severity and Description Path Resource Location Creation Time Id
/usr/include/boost/regex/pattern_except.hpp undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)' line 68 1199459180470 4287
/usr/include/boost/regex/v4/basic_regex.hpp undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)' line 255 1199459180459 4278
/usr/include/boost/regex/v4/cpp_regex_traits.hpp undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const' line 880 1199459180467 4282
/usr/include/boost/regex/v4/cpp_regex_traits.hpp undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const' line 876 1199459180466 4281
/usr/include/boost/regex/v4/cpp_regex_traits.hpp undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' line 424 1199459180468 4285
/usr/include/boost/regex/v4/cpp_regex_traits.hpp undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' line 426 1199459180469 4286
/usr/include/boost/regex/v4/perl_matcher_common.hpp undefined reference to `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> > > > > >::maybe_assign(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> > > > > > const&)' line 468 1199459180468 4284
/usr/include/boost/regex/v4/perl_matcher_common.hpp undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)' line 279 1199459180473 4291
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp undefined reference to `boost::re_detail::get_mem_block()' line 96 1199459180467 4283
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp undefined reference to `boost::re_detail::get_mem_block()' line 186 1199459180471 4288
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp undefined reference to `boost::re_detail::put_mem_block(void*)' line 104 1199459180472 4290
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp undefined reference to `boost::re_detail::put_mem_block(void*)' line 965 1199459180471 4289
/usr/include/boost/regex/v4/perl_matcher.hpp 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::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)' line 335 1199459180463 4279
/usr/include/boost/regex/v4/regex_search.hpp 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::cpp_regex_traits<char> > >::find()' line 49 1199459180464 4280
The code using regex (there are three functions like this... they are nearly identical except for some defaults and types)...
Code:
std::list<boost::shared_ptr<ProjectileType> > parseProjectiles(std::string file)
{
std::list<boost::shared_ptr<ProjectileType> > projyTypes;
std::map<std::string,std::string> tags;
std::ifstream input;
input.open(file.c_str(),std::ios::in);
std::string fileData((std::istreambuf_iterator<char>(input)), std::istreambuf_iterator<char>());
boost::regex bracketRule("\{(. | \n)*?}", boost::regex::icase);
boost::smatch bracketResults;
boost::regex tagRule(" *?(.*)? *?= *?(.*)? *?\n", boost::regex::icase);
boost::smatch tagResults;
std::string::const_iterator startB, endB, startT, endT;
startB = fileData.begin();
endB = fileData.end();
while (boost::regex_search(startB, endB, bracketResults, bracketRule))
{
tags["name"] = "loller";
tags["velocity"] = "500";
tags["areaofeffect"] = "0";
tags["damage"] = "1";
tags["graphic"] = "data/projectiles/bullet.png";
startT = bracketResults.str(1).begin();
endT = bracketResults.str(1).end();
while (boost::regex_search(startT, endT, tagResults, tagRule))
{
tags[tagResults[1]] = tagResults[2];
}
boost::shared_ptr<ProjectileType> newprojy(new ProjectileType(tags));
projyTypes.push_back(newprojy);
}
return projyTypes;
}
Sorry about the massive post width but I figured those errors should be formatted properly.