build boost c ++ 1.48.0 с помощью создателя qt - PullRequest
0 голосов
/ 25 февраля 2012

Я пытался собрать c ++ boost для работы с qt creator, но до сих пор все, что я получаю, это неопределенная ссылка на разные вещи, так что вот что я делал до сих пор: -

  1. Я создаю C ++ Boost, запустив bootstrap.bat, а затем bjam
  2. Я включаю путь в мой проект qt creator .pro

как это

QT += core gui

TARGET = Heap
TEMPLATE = app

INCLUDEPATH += C:\boost\boost_1_48_0

LIBS += -L"C:/boost/boost_1_48_0/stage/lib"

SOURCES += \
    main.cpp

HEADERS  += \
    clss.h \
    inputstream.h \
    outputstream.h \
    myexception.h \
    heaptest.h \
    comparable.h \
    heap.h

FORMS    +=

вот мой пример кода, который я тестирую на

#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main()
{
    std::string line;
    boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );

    while (std::cin)
    {
        std::getline(std::cin, line);
        boost::smatch matches;
        if (boost::regex_match(line, matches, pat))
            std::cout << matches[2] << std::endl;
    }
}

и вот ошибка компиляции, которую я получаю

debug/main.o: In function `cpp_regex_traits_char_layer':
C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail::put_mem_block(void*)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/perl_matcher_common.hpp:206: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/perl_matcher_non_recursive.hpp:1117: undefined reference to `boost::re_detail::put_mem_block(void*)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::raise() const'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:798: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:799: undefined reference to `boost::regex_error::raise() const'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:799: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:799: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:880: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:881: undefined reference to `boost::regex_error::raise() const'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:881: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:881: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:945: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:946: undefined reference to `boost::regex_error::raise() const'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:946: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:946: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:1148: undefined reference to `boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, int)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:1149: undefined reference to `boost::regex_error::raise() const'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:1149: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:1149: undefined reference to `boost::regex_error::~regex_error()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/perl_matcher_non_recursive.hpp:213: undefined reference to `boost::re_detail::get_mem_block()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/basic_regex_creator.hpp:321: undefined reference to `boost::re_detail::raw_storage::insert(unsigned int, unsigned int)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/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:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/pending/object_cache.hpp:75: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:633: undefined reference to `boost::re_detail::lookup_default_collate_name(std::string const&)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:675: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:690: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:1059: undefined reference to `boost::scoped_static_mutex_lock::scoped_static_mutex_lock(boost::static_mutex&, bool)'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:1062: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
debug/main.o:C:\Users\Aamer\Desktop\Heap-build-desktop-Qt_4_8_0__4_8_0__Debug/../../../../boost/boost_1_48_0/boost/regex/v4/cpp_regex_traits.hpp:1062: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [debug/Heap.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
16:05:31: The process "C:\Qt\qtcreator-2.4.0\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project Heap (target: Desktop)
When executing build step 'Make'

Как я могу получить это, чтобы построить?

1 Ответ

1 голос
/ 25 февраля 2012

Попробуйте изменить строку LIBS += -L"C:/boost/boost_1_48_0/stage/lib" на:

LIBS += -L"C:/boost/boost_1_48_0/stage/lib" -lboost_regex

(замените boost_regex на фактическое имя встроенной библиотеки (которое, вероятно, будет выглядеть как boost_regex-mgw44-mt-1_48))

...