Настройка среды для C ++ / Boost libs (netbeans или eclipse) - PullRequest
3 голосов
/ 15 мая 2011

Я следовал очень многим урокам сейчас и не могу понять эту основную, фундаментальную вещь правильно Я начинаю работать с C ++ и перехожу к стандартному вводному материалу (после двух книг), и я работаю над «За пределами стандартной библиотеки C ++ ~ Введение в Boost», но я не могу получить ни Netbeans, ни Eclipse скомпилировать и запустить мои проекты наддува.

Я смотрел на Как настроить Boost с Netbeans 6.9 в Ubuntu http://www.fischerlaender.net/development/using-boost-c-libraries-with-gcc-g-under-windows и несколько других, но я не могу понять это правильно. В Netbeans (мое предпочтение) я дошел до того, что указал дополнительные каталоги include, и netbeans распознает его в той степени, в которой он обеспечивает автоматическое завершение при включении чего-либо из boost / *, например, #include хорошо, но когда я пытаюсь скомпилировать его Я получаю:

mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++.exe    -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
main.cpp:7:27: fatal error: boost/regex.hpp: No such file or directory
compilation terminated.
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'
make[1]: Leaving directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'

но я не понимаю, почему файл не может быть найден ... любая помощь очень ценится. UPDATE Установите каталог включения в Свойства-> Компилятор C ++ и выберите 32 бита в качестве архитектуры. Ошибка компиляции изменена на:

"/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'
"/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/helloboost.exe
make[2]: Entering directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++.exe -m32   -c -g -I/C/Program\ Files\ \(x86\)/boost/boost_1_46_1 -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-Windows
g++.exe -m32    -o dist/Debug/MinGW-Windows/helloboost build/Debug/MinGW-Windows/main.o  
build/Debug/MinGW-Windows/main.o: In function `cpp_regex_traits_char_layer':
c:/Program Files (x86)/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()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/regex_raw_buffer.hpp:131: undefined reference to `boost::re_detail::raw_storage::resize(unsigned int)'
build/Debug/MinGW-Windows/main.o: In function `save_state_init':
c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:107: undefined reference to `boost::re_detail::get_mem_block()'
build/Debug/MinGW-Windows/main.o: In function `~save_state_init':
c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to `boost::re_detail::put_mem_block(void*)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/perl_matcher_common.hpp:206: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1117: undefined reference to `boost::re_detail::put_mem_block(void*)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/pattern_except.hpp:75: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:219: undefined reference to `boost::regex_error::raise() const'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:218: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_parser.hpp:218: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:796: undefined reference to `boost::regex_error::raise() const'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:795: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:878: undefined reference to `boost::regex_error::raise() const'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:877: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:795: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:877: undefined reference to `boost::regex_error::~regex_error()'
make[2]: Leaving directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
make[1]: Leaving directory `/c/Users/Courtney/Documents/Projects/Desktop/HelloBoost'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:943: undefined reference to `boost::regex_error::raise() const'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:942: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:942: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1134: undefined reference to `boost::regex_error::raise() const'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1133: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/basic_regex_creator.hpp:1133: undefined reference to `boost::regex_error::~regex_error()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/v4/perl_matcher_non_recursive.hpp:213: undefined reference to `boost::re_detail::get_mem_block()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/pending/object_cache.hpp:66: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/boost/boost_1_46_1/boost/regex/pending/object_cache.hpp:66: undefined reference to `boost::scoped_static_mutex_lock::~scoped_static_mutex_lock()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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&)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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&)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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)'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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()'
build/Debug/MinGW-Windows/main.o:c:/Program Files (x86)/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()'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/helloboost.exe] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 31s)

1 Ответ

0 голосов
/ 15 мая 2011
g++.exe    -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp

Эта команда компиляции не имеет необходимого ключа -I.Похоже, что каталог include был установлен не в том месте.Может быть, он был задан только для автозаполнения, но не для компиляции?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...