Добрый день! Нужда в реализации парсера поддтолкнула на приобщение к высокому... а именно boost.regex Однако столкнулся с проблемой компановки (ошибки ниже), судя по всему компилятор не может найти нужный lib, вот только не могу понять какой и, собственно, где в pro-файле нужно его указать (путь до буста и собранных библиотек вроде указываю же). Pro-file Код | QT += core QT -= gui INCLUDEPATH += \ C:/Soft/boost/boost_1_46_1 \ C:/Soft/boost/boost_1_46_1/stage/lib TARGET = CppHelloBoost CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
|
main.cpp Код | #include <iostream> #include <boost/regex.hpp>
int main() { std::string s = "Hello World"; s = boost::regex_replace(s,boost::regex("World"),std::string("Boost")); std::cout << s << '\n'; }
|
(!) Тот самый список ошибок при компиляции Код | debug/main.o: In function `cpp_regex_traits_char_layer': c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:366: undefined reference to `boost::re_detail::cpp_regex_traits_char_layer<char>::init()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/regex_raw_buffer.hpp:131: undefined reference to `boost::re_detail::raw_storage::resize(unsigned int)' debug/main.o: In function `save_state_init': c:/Soft/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:107: undefined reference to `boost::re_detail::get_mem_block()' debug/main.o: In function `~save_state_init': c:/Soft/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail::put_mem_block(void*)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/perl_matcher_common.hpp:292: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:218: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::raise() const' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:795: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:796: undefined reference to `boost::regex_error::raise() const' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:796: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:796: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:877: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:878: undefined reference to `boost::regex_error::raise() const' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:878: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:878: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:942: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:943: undefined reference to `boost::regex_error::raise() const' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:943: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:943: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1133: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1134: undefined reference to `boost::regex_error::raise() const' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1134: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1134: undefined reference to `boost::regex_error::~regex_error()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:442: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:444: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:320: undefined reference to `boost::re_detail::raw_storage::insert(unsigned int, unsigned int)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1117: undefined reference to `boost::re_detail::put_mem_block(void*)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/pending/object_cache.hpp:66: undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:625: undefined reference to `boost::re_detail::lookup_default_collate_name(std::string const&)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:213: undefined reference to `boost::re_detail::get_mem_block()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:667: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:682: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:1051: undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:1054: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()' debug/main.o:c:/Soft/boost/boost_1_46_1/boost/regex/v4/cpp_regex_traits.hpp:1054: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()' collect2: ld returned 1 exit status mingw32-make.exe[1]: *** [debug/CppHelloBoost.exe] Error 1 mingw32-make.exe[1]: Leaving directory `D:/My_Docs/!Progs/!Training/Boost_Regex2' mingw32-make.exe: *** [debug] Error 2
|
В аттаче qt проект с кодом. Буду рад любым советам и предложениям! Добавлено @ 18:58Собственно пример проекта взят от сюдаИ в pro-файле указывается интересный момент: Цитата | win32:LIBS +=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib
|
Судя по путям, в qt/lib попросту собран boost. У меня они лежат в дефолтном boost/boost_1_46_1/stage/lib , но у меня нет "libboost_regex.lib" и в памине Прилинковка существующих: (libboost_regex-vc100-mt.lib) (libboost_regex-vc100-mt-1_46_1.lib) (libboost_regex-vc100-mt-gd.lib) (libboost_regex-vc100-mt-gd-1_46_1.lib) не дала результата Это сообщение отредактировал(а) CaLaT - 17.6.2011, 19:09
Присоединённый файл ( Кол-во скачиваний: 3 )
Boost_Regex.zip 1,55 Kb
|