Newbie Question - Errors if i want to compile
Hi everybody. I'm a new user of boost c++. I tried to install it on my Mac. I followed "Getting Started on Unix variant" guide which I found on boost.org site. The first part is ok, I tried to compile and execute the simple example and i had no problem, it runs. After it I tried to build and install the separately-compiled Boost libraries, I copied the example in my editor and I typed on terminal: c++ -I /Users/Simone/Documents/workspace/boost_1_49_0 main.cpp -o main\ ~/boost/stage/lib/libboost_regex-darwin-mt-d-1_49_0.a but the result was: Undefined symbols: "boost::re_detail::get_mem_block()", referenced from: 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> > >::extend_stack()in ccmv1in1.o "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&)", referenced from: 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> > >::match_match()in ccmv1in1.o "boost::re_detail::get_default_error_string(boost::regex_constants::error_type)", referenced from: boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) constin ccmv1in1.o boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) constin ccmv1in1.o "boost::re_detail::put_mem_block(void*)", referenced from: 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> > >::unwind_extra_block(bool)in ccmv1in1.o "boost::re_detail::raise_runtime_error(std::runtime_error const&)", referenced from: void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > (boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)in ccmv1in1.o "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> > >::match()", referenced from: bool boost::regex_match<__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> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > , 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> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)in ccmv1in1.o "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)", referenced from: 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> > ::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > , __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, 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> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)in ccmv1in1.o "boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const", referenced from: boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) constin ccmv1in1.o "boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const", referenced from: boost::cpp_regex_traits<char>::transform(char const*, char const*) constin ccmv1in1.o "boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)", referenced from: boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)in ccmv1in1.o ld: symbol(s) not found
collect2: ld returned 1 exit status
Even if I used the other way to compile, ("separately specify a directory to search (with -Ldirectory)"), the result is always the same. What can I do?? Thank You Simone
On Thu, Mar 15, 2012 at 9:03 AM, Simone Piacco <crazypumpkin10@gmail.com> wrote:
Hi everybody. I'm a new user of boost c++. I tried to install it on my Mac. I followed "Getting Started on Unix variant" guide which I found on boost.org site. The first part is ok, I tried to compile and execute the simple example and i had no problem, it runs. After it I tried to build and install the separately-compiled Boost libraries, I copied the example in my editor and I typed on terminal:
c++ -I /Users/Simone/Documents/workspace/boost_1_49_0 main.cpp -o main\ ~/boost/stage/lib/libboost_regex-darwin-mt-d-1_49_0.a
It looks like a path problem to the library. If your -I include directive is right then your boost libraries would be at /Users/Simone/Documents/workspace/boost_1_49_0/stage/lib and not in ~/boost/stage/lib. ~ would only equate to /Users/Simone -- Glenn R Heard Jr grheard (at) gmail (.) com draeh (at) tacticalgamer (.) com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! Am 15.03.12 14:03, schrieb Simone Piacco:
c++ -I /Users/Simone/Documents/workspace/boost_1_49_0 main.cpp -o main\ ~/boost/stage/lib/libboost_regex-darwin-mt-d-1_49_0.a
If this is really your commandline then the library is actually missing: the backslash after "-o main" will escape the space. So your "-o" option has the value "main ~/boost/stage/lib/libboost_regex-darwin-mt-d-1_49_0.a". I guess you are fine when you simply remove the backslash, making "main" and the library two different arguments: -o main ~/boost/stage/... Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: keyserver x-hkp://pool.sks-keyservers.net iEYEARECAAYFAk9iYfcACgkQhAOUmAZhnmrHFQCfc6yCsDTEUKy6UrGMH9H7h+uG iwcAnRolmrezMvNe+WH7pXsbXh093+bN =Jdbk -----END PGP SIGNATURE-----
participants (3)
-
Frank Birbacher
-
Glenn R Heard Jr
-
Simone Piacco