undefined reference to `std::basic_string...



  • Hi,

    beim lernen von c++ bin ich bei dem volgenden bsp Code auf ein für mich undefinierbaren compilerfehler gestoßen.

    #include <boost/filesystem/path.hpp>
    #include <boost/filesystem/operations.hpp>
    #include <iostream>
    #include <cerrno>
    
    void ls(boost::filesystem::path const &pfad) {
    	if (!boost::filesystem::exists(pfad))
    		std::cerr << "Pfad '" << pfad.native_file_string() << "' existiert nicht" << std::endl;
    	else
    		std::cout << pfad.native_file_string() << std::endl;
    }
    
    int main(int argc, char **argv) {
    	if(argc > 1)
    		for (int i=1; i<argc;++i)
    			ls(boost::filesystem::path(argv[i], boost::filesystem::native));
    	else {
    		std::cerr << "usage: " << *argv << " <pfad> ...n";
    		return 1;
    	}
    }
    

    der Compiler meldet folgende Fehler ??

    /tmp/ccYKs2h8.o: In function `std::__verify_grouping(char const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    Bsp1.cpp:(.text+0x1a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
    Bsp1.cpp:(.text+0x65): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long) const'
    Bsp1.cpp:(.text+0xa4): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long) const'
    Bsp1.cpp:(.text+0xed): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long) const'
    /tmp/ccYKs2h8.o: In function `__static_initialization_and_destruction_0(int, int)':
    Bsp1.cpp:(.text+0x13f): undefined reference to `std::ios_base::Init::Init()'
    /tmp/ccYKs2h8.o: In function `__tcf_4':
    Bsp1.cpp:(.text+0x182): undefined reference to `std::ios_base::Init::~Init()'
    /tmp/ccYKs2h8.o: In function `ls(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)':
    Bsp1.cpp:(.text+0x1b8): undefined reference to `std::cerr'
    Bsp1.cpp:(.text+0x1bd): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    Bsp1.cpp:(.text+0x1c9): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    Bsp1.cpp:(.text+0x1d6): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    Bsp1.cpp:(.text+0x1de): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
    Bsp1.cpp:(.text+0x1e3): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
    Bsp1.cpp:(.text+0x1ec): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text+0x1ff): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text+0x222): undefined reference to `std::cout'
    Bsp1.cpp:(.text+0x227): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    Bsp1.cpp:(.text+0x22f): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
    Bsp1.cpp:(.text+0x234): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
    Bsp1.cpp:(.text+0x23d): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text+0x250): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    /tmp/ccYKs2h8.o: In function `main':
    Bsp1.cpp:(.text+0x29c): undefined reference to `boost::filesystem::native(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    Bsp1.cpp:(.text+0x2f9): undefined reference to `std::cerr'
    Bsp1.cpp:(.text+0x2fe): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    Bsp1.cpp:(.text+0x309): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    Bsp1.cpp:(.text+0x316): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
    /tmp/ccYKs2h8.o: In function `std::exception::exception(std::exception const&)':
    Bsp1.cpp:(.text._ZNSt9exceptionC2ERKS_[std::exception::exception(std::exception const&)]+0xd): undefined reference to `vtable for std::exception'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::~basic_path()':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEED1Ev[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::~basic_path()]+0x11): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::basic_path()':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEEC1Ev[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::basic_path()]+0x11): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::operator=(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEEaSERKS3_[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::operator=(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::empty() const':
    Bsp1.cpp:(.text._ZNK5boost10filesystem10basic_pathISsNS0_11path_traitsEE5emptyEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::empty() const]+0x11): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::m_append(char)':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEE8m_appendEc[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::m_append(char)]+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::m_append_separator_if_needed()':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEE28m_append_separator_if_neededEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::m_append_separator_if_needed()]+0x19): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::end()'
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEE28m_append_separator_if_neededEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::m_append_separator_if_needed()]+0x51): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::basic_path(char const*, bool (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))':
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEEC1EPKcPFbRKSsE[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::basic_path(char const*, bool (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))]+0x1a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
    Bsp1.cpp:(.text._ZN5boost10filesystem10basic_pathISsNS0_11path_traitsEEC1EPKcPFbRKSsE[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::basic_path(char const*, bool (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))]+0x3a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::file_string() const':
    Bsp1.cpp:(.text._ZNK5boost10filesystem10basic_pathISsNS0_11path_traitsEE11file_stringEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::file_string() const]+0x18): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::path_traits::to_external(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
    Bsp1.cpp:(.text._ZN5boost10filesystem11path_traits11to_externalERKNS0_10basic_pathISsS1_EERKSs[boost::filesystem::path_traits::to_external(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x1c): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::external_file_string() const':
    Bsp1.cpp:(.text._ZNK5boost10filesystem10basic_pathISsNS0_11path_traitsEE20external_file_stringEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::external_file_string() const]+0x37): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text._ZNK5boost10filesystem10basic_pathISsNS0_11path_traitsEE20external_file_stringEv[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits>::external_file_string() const]+0x4a): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    /tmp/ccYKs2h8.o: In function `boost::detail::sp_counted_base::~sp_counted_base()':
    Bsp1.cpp:(.text._ZN5boost6detail15sp_counted_baseD2Ev[boost::detail::sp_counted_base::~sp_counted_base()]+0x26): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::detail::sp_counted_impl_p<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>::~sp_counted_impl_p()':
    Bsp1.cpp:(.text._ZN5boost6detail17sp_counted_impl_pINS_10filesystem22basic_filesystem_errorINS2_10basic_pathISsNS2_11path_traitsEEEE5m_impEED0Ev[boost::detail::sp_counted_impl_p<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>::~sp_counted_impl_p()]+0x2f): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::detail::sp_counted_base::~sp_counted_base()':
    Bsp1.cpp:(.text._ZN5boost6detail15sp_counted_baseD0Ev[boost::detail::sp_counted_base::~sp_counted_base()]+0x26): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::detail::sp_counted_base::~sp_counted_base()':
    Bsp1.cpp:(.text._ZN5boost6detail15sp_counted_baseD1Ev[boost::detail::sp_counted_base::~sp_counted_base()]+0x26): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::detail::sp_counted_impl_p<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>::~sp_counted_impl_p()':
    Bsp1.cpp:(.text._ZN5boost6detail17sp_counted_impl_pINS_10filesystem22basic_filesystem_errorINS2_10basic_pathISsNS2_11path_traitsEEEE5m_impEED1Ev[boost::detail::sp_counted_impl_p<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>::~sp_counted_impl_p()]+0x2f): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o:Bsp1.cpp:(.text._ZN5boost14checked_deleteINS_10filesystem22basic_filesystem_errorINS1_10basic_pathISsNS1_11path_traitsEEEE5m_impEEEvPT_[void boost::checked_delete<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)]+0x29): more undefined references to `operator delete(void*)' follow
    /tmp/ccYKs2h8.o: In function `boost::filesystem::filesystem_error::filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorC2ERKSsi[boost::filesystem::filesystem_error::filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0x1c): undefined reference to `std::runtime_error::runtime_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::filesystem_error::~filesystem_error()':
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD0Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x1d): undefined reference to `std::runtime_error::~runtime_error()'
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD0Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x2f): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::filesystem_error::~filesystem_error()':
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD1Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x1d): undefined reference to `std::runtime_error::~runtime_error()'
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD1Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x2f): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::filesystem_error::~filesystem_error()':
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD2Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x1d): undefined reference to `std::runtime_error::~runtime_error()'
    Bsp1.cpp:(.text._ZN5boost10filesystem16filesystem_errorD2Ev[boost::filesystem::filesystem_error::~filesystem_error()]+0x2f): undefined reference to `operator delete(void*)'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()':
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEED0Ev[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()]+0x77): undefined reference to `operator delete(void*)'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEED0Ev[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()]+0x92): undefined reference to `__cxa_call_unexpected'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()':
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEED1Ev[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()]+0x77): undefined reference to `operator delete(void*)'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEED1Ev[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::~basic_filesystem_error()]+0x92): undefined reference to `__cxa_call_unexpected'
    /tmp/ccYKs2h8.o: In function `boost::detail::shared_count::shared_count<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)':
    Bsp1.cpp:(.text._ZN5boost6detail12shared_countC1INS_10filesystem22basic_filesystem_errorINS3_10basic_pathISsNS3_11path_traitsEEEE5m_impEEEPT_[boost::detail::shared_count::shared_count<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)]+0x22): undefined reference to `operator new(unsigned long)'
    Bsp1.cpp:(.text._ZN5boost6detail12shared_countC1INS_10filesystem22basic_filesystem_errorINS3_10basic_pathISsNS3_11path_traitsEEEE5m_impEEEPT_[boost::detail::shared_count::shared_count<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)]+0x4a): undefined reference to `__cxa_begin_catch'
    Bsp1.cpp:(.text._ZN5boost6detail12shared_countC1INS_10filesystem22basic_filesystem_errorINS3_10basic_pathISsNS3_11path_traitsEEEE5m_impEEEPT_[boost::detail::shared_count::shared_count<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)]+0x58): undefined reference to `__cxa_rethrow'
    Bsp1.cpp:(.text._ZN5boost6detail12shared_countC1INS_10filesystem22basic_filesystem_errorINS3_10basic_pathISsNS3_11path_traitsEEEE5m_impEEEPT_[boost::detail::shared_count::shared_count<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp*)]+0x65): undefined reference to `__cxa_end_catch'
    /tmp/ccYKs2h8.o: In function `boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)':
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEC1ERKSsRKS4_i[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)]+0x47): undefined reference to `operator new(unsigned long)'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEC1ERKSsRKS4_i[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)]+0x78): undefined reference to `operator delete(void*)'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEC1ERKSsRKS4_i[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)]+0xa6): undefined reference to `__cxa_begin_catch'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEC1ERKSsRKS4_i[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)]+0xb8): undefined reference to `__cxa_end_catch'
    Bsp1.cpp:(.text._ZN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEC1ERKSsRKS4_i[boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::basic_filesystem_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&, int)]+0xc7): undefined reference to `__cxa_end_catch'
    /tmp/ccYKs2h8.o: In function `std::runtime_error::runtime_error(std::runtime_error const&)':
    Bsp1.cpp:(.text._ZNSt13runtime_errorC2ERKS_[std::runtime_error::runtime_error(std::runtime_error const&)]+0x1f): undefined reference to `vtable for std::runtime_error'
    Bsp1.cpp:(.text._ZNSt13runtime_errorC2ERKS_[std::runtime_error::runtime_error(std::runtime_error const&)]+0x3b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    Bsp1.cpp:(.text._ZNSt13runtime_errorC2ERKS_[std::runtime_error::runtime_error(std::runtime_error const&)]+0x4e): undefined reference to `std::exception::~exception()'
    /tmp/ccYKs2h8.o: In function `void boost::throw_exception<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > >(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&)':
    Bsp1.cpp:(.text._ZN5boost15throw_exceptionINS_10filesystem22basic_filesystem_errorINS1_10basic_pathISsNS1_11path_traitsEEEEEEEvRKT_[void boost::throw_exception<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > >(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&)]+0x12): undefined reference to `__cxa_allocate_exception'
    Bsp1.cpp:(.text._ZN5boost15throw_exceptionINS_10filesystem22basic_filesystem_errorINS1_10basic_pathISsNS1_11path_traitsEEEEEEEvRKT_[void boost::throw_exception<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > >(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&)]+0x36): undefined reference to `__cxa_throw'
    Bsp1.cpp:(.text._ZN5boost15throw_exceptionINS_10filesystem22basic_filesystem_errorINS1_10basic_pathISsNS1_11path_traitsEEEEEEEvRKT_[void boost::throw_exception<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > >(boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> > const&)]+0x4e): undefined reference to `std::terminate()'
    /tmp/ccYKs2h8.o: In function `boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)':
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x26): undefined reference to `boost::filesystem::detail::status_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&)'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x32): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x55): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x77): undefined reference to `std::allocator<char>::allocator()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x89): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0xb8): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0xf1): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x103): undefined reference to `std::allocator<char>::~allocator()'
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x11c): undefined reference to `std::allocator<char>::~allocator()'
    /tmp/ccYKs2h8.o:(.rodata._ZTVN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEE[vtable for boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >]+0x20): undefined reference to `std::runtime_error::what() const'
    /tmp/ccYKs2h8.o:(.rodata._ZTIN5boost10filesystem22basic_filesystem_errorINS0_10basic_pathISsNS0_11path_traitsEEEEE[typeinfo for boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
    /tmp/ccYKs2h8.o:(.rodata._ZTIN5boost10filesystem16filesystem_errorE[typeinfo for boost::filesystem::filesystem_error]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
    /tmp/ccYKs2h8.o:(.rodata._ZTIN5boost10filesystem16filesystem_errorE[typeinfo for boost::filesystem::filesystem_error]+0x10): undefined reference to `typeinfo for std::runtime_error'
    /tmp/ccYKs2h8.o:(.rodata._ZTVN5boost10filesystem16filesystem_errorE[vtable for boost::filesystem::filesystem_error]+0x20): undefined reference to `std::runtime_error::what() const'
    /tmp/ccYKs2h8.o:(.rodata._ZTIN5boost6detail17sp_counted_impl_pINS_10filesystem22basic_filesystem_errorINS2_10basic_pathISsNS2_11path_traitsEEEE5m_impEEE[typeinfo for boost::detail::sp_counted_impl_p<boost::filesystem::basic_filesystem_error<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >::m_imp>]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
    /tmp/ccYKs2h8.o:(.rodata._ZTIN5boost6detail15sp_counted_baseE[typeinfo for boost::detail::sp_counted_base]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
    /tmp/ccYKs2h8.o:(.rodata._ZTVN5boost6detail15sp_counted_baseE[vtable for boost::detail::sp_counted_base]+0x20): undefined reference to `__cxa_pure_virtual'
    /tmp/ccYKs2h8.o:(.rodata._ZTVN5boost6detail15sp_counted_baseE[vtable for boost::detail::sp_counted_base]+0x30): undefined reference to `__cxa_pure_virtual'
    /tmp/ccYKs2h8.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
    collect2: ld returned 1 exit status
    

    Soll auf einem Debian Linux system zum testen laufen.

    Für Tips was daran Falsch ist oder fehlt bin ich sehr Dankbar.

    Danke im vorraus schonmal
    Frank



  • Du linkst scheinbar die libstdc++ nicht dazu.
    Wie rufst du denn den Compiler auf?



  • wie bisher immer mit "gcc -o bsp1 bsp1.cpp" so wie ich es bisher immer gemacht hatte?

    wie wie link ich die denn dazu?

    Frank



  • nimm g++ statt gcc



  • Ok danke, aber jetzt kommen folgende fehlermeldungen?

    /tmp/cc1tpBSE.o: In function `main':
    Bsp1.cpp:(.text+0x29c): undefined reference to `boost::filesystem::native(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/cc1tpBSE.o: In function `boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)':
    Bsp1.cpp:(.text._ZN5boost10filesystem6existsINS0_10basic_pathISsNS0_11path_traitsEEEEENS_9enable_ifINS0_13is_basic_pathIT_EEbE4typeERKS7_[boost::enable_if<boost::filesystem::is_basic_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >, bool>::type boost::filesystem::exists<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >(boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> const&)]+0x26): undefined reference to `boost::filesystem::detail::status_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int&)'
    collect2: ld returned 1 exit status
    

    Frank



  • So, und jetzt noch Boost.Filesystem dazulinken dann gehts.

    -lbboost_filesystem-gcc42-mt-1_35
    

    oder so ähnlich



  • Super danke, es funktioniert und wieder was dazu gelernt was bisher nicht im buch oder so steht danke.

    Frank

    PS: Man seit ihr schnell im antworten!!!!


Anmelden zum Antworten