Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when compiling C++ #1

Open
mcaron1234 opened this issue Nov 21, 2017 · 2 comments
Open

Error when compiling C++ #1

mcaron1234 opened this issue Nov 21, 2017 · 2 comments

Comments

@mcaron1234
Copy link

I am getting an error when I try compiling the C++ version. Can you spot my mistake?

matt@apollo:~/Downloads/dev/mag2tor$ sudo make g++ -std=c++11 -DBOOST_ASIO_DYN_LINK -lstdc++ -lboost_system -ltorrent-rasterbar mag2tor.cpp -o mag2tor mag2tor.cpp: In function ‘int main(int, char**)’: mag2tor.cpp:94:36: warning: ‘libtorrent::session::session(const libtorrent::fingerprint&, int, uint32_t)’ is deprecated [-Wdeprecated-declarations] lt::session::add_default_plugins); ^ In file included from mag2tor.cpp:16:0: /usr/include/libtorrent/session.hpp:205:3: note: declared here session(fingerprint const& print ^~~~~~~ mag2tor.cpp:95:24: warning: ‘void libtorrent::session_handle::set_settings(const libtorrent::session_settings&)’ is deprecated [-Wdeprecated-declarations] sess.set_settings(sset); ^ In file included from /usr/include/libtorrent/session.hpp:53:0, from mag2tor.cpp:16: /usr/include/libtorrent/session_handle.hpp:808:8: note: declared here void set_settings(session_settings const& s); ^~~~~~~~~~~~ mag2tor.cpp:114:26: warning: ‘void libtorrent::session_handle::pop_alerts(std::deque<libtorrent::alert*>*)’ is deprecated [-Wdeprecated-declarations] sess.pop_alerts(&alerts); ^ In file included from /usr/include/libtorrent/session.hpp:53:0, from mag2tor.cpp:16: /usr/include/libtorrent/session_handle.hpp:916:8: note: declared here void pop_alerts(std::deque<alert*>* alerts); ^~~~~~~~~~ mag2tor.cpp:126:27: warning: ‘const libtorrent::torrent_info& libtorrent::torrent_handle::get_torrent_info() const’ is deprecated [-Wdeprecated-declarations] torh.get_torrent_info(); ^ In file included from /usr/include/libtorrent/alert_types.hpp:38:0, from mag2tor.cpp:12: /usr/include/libtorrent/torrent_handle.hpp:920:23: note: declared here const torrent_info& get_torrent_info() const; ^~~~~~~~~~~~~~~~ /tmp/cciTCjJL.o: In function main':
mag2tor.cpp:(.text+0x1ab): undefined reference to libtorrent::session_settings::session_settings(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' mag2tor.cpp:(.text+0x1dc): undefined reference to libtorrent::default_storage_constructor(libtorrent::storage_params const&)'
mag2tor.cpp:(.text+0x43d): undefined reference to libtorrent::session_handle::set_settings(libtorrent::session_settings const&)' mag2tor.cpp:(.text+0x467): undefined reference to libtorrent::disabled_storage_constructor(libtorrent::storage_params const&)'
mag2tor.cpp:(.text+0x4ae): undefined reference to libtorrent::session_handle::add_torrent(libtorrent::add_torrent_params const&)' mag2tor.cpp:(.text+0x501): undefined reference to libtorrent::session_handle::pop_alerts(std::deque<libtorrent::alert*, std::allocatorlibtorrent::alert* >)'
mag2tor.cpp:(.text+0x665): undefined reference to libtorrent::torrent_handle::status(unsigned int) const' mag2tor.cpp:(.text+0x67b): undefined reference to libtorrent::torrent_status::~torrent_status()'
mag2tor.cpp:(.text+0x692): undefined reference to libtorrent::session_handle::pause()' mag2tor.cpp:(.text+0x6a1): undefined reference to libtorrent::torrent_handle::get_torrent_info() const'
mag2tor.cpp:(.text+0x6b6): undefined reference to libtorrent::torrent_info::torrent_info(libtorrent::torrent_info const&)' mag2tor.cpp:(.text+0x7b6): undefined reference to libtorrent::create_torrent::create_torrent(libtorrent::torrent_info const&)'
mag2tor.cpp:(.text+0x7cf): undefined reference to libtorrent::create_torrent::generate() const' mag2tor.cpp:(.text+0x810): undefined reference to libtorrent::entry::~entry()'
mag2tor.cpp:(.text+0x81f): undefined reference to libtorrent::create_torrent::~create_torrent()' mag2tor.cpp:(.text+0x84c): undefined reference to libtorrent::session_handle::remove_torrent(libtorrent::torrent_handle const&, int)'
mag2tor.cpp:(.text+0x86b): undefined reference to libtorrent::torrent_info::~torrent_info()' mag2tor.cpp:(.text+0x910): undefined reference to libtorrent::session::~session()'
mag2tor.cpp:(.text+0x92e): undefined reference to libtorrent::session_settings::~session_settings()' mag2tor.cpp:(.text+0x9ca): undefined reference to libtorrent::entry::~entry()'
mag2tor.cpp:(.text+0x9de): undefined reference to libtorrent::create_torrent::~create_torrent()' mag2tor.cpp:(.text+0xa06): undefined reference to libtorrent::torrent_info::~torrent_info()'
mag2tor.cpp:(.text+0xa42): undefined reference to libtorrent::session::~session()' mag2tor.cpp:(.text+0xa6a): undefined reference to libtorrent::session_settings::~session_settings()'
/tmp/cciTCjJL.o: In function __static_initialization_and_destruction_0(int, int)': mag2tor.cpp:(.text+0xae7): undefined reference to boost::system::generic_category()'
mag2tor.cpp:(.text+0xaf3): undefined reference to boost::system::generic_category()' mag2tor.cpp:(.text+0xaff): undefined reference to boost::system::system_category()'
mag2tor.cpp:(.text+0xb17): undefined reference to boost::asio::error::get_netdb_category()' mag2tor.cpp:(.text+0xb23): undefined reference to boost::asio::error::get_addrinfo_category()'
mag2tor.cpp:(.text+0xb2f): undefined reference to boost::asio::error::get_misc_category()' /tmp/cciTCjJL.o: In function boost::asio::error::get_system_category()':
mag2tor.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to boost::system::system_category()' /tmp/cciTCjJL.o: In function libtorrent::session::session(libtorrent::fingerprint const&, int, unsigned int)':
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x83): undefined reference to libtorrent::ipv6_deprecated_()' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0xac): undefined reference to libtorrent::settings_pack::set_int(int, int)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0xda): undefined reference to libtorrent::settings_pack::set_str(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x10c): undefined reference to libtorrent::settings_pack::set_bool(int, bool)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x125): undefined reference to libtorrent::settings_pack::set_bool(int, bool)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x13e): undefined reference to libtorrent::settings_pack::set_bool(int, bool)'
mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x157): undefined reference to libtorrent::settings_pack::set_bool(int, bool)' mag2tor.cpp:(.text._ZN10libtorrent7sessionC2ERKNS_11fingerprintEij[_ZN10libtorrent7sessionC5ERKNS_11fingerprintEij]+0x178): undefined reference to libtorrent::session::start(int, libtorrent::settings_pack const&, boost::asio::io_service
)'
/tmp/cciTCjJL.o: In function int libtorrent::detail::bencode_recursive<std::ostream_iterator<char, char, std::char_traits<char> > >(std::ostream_iterator<char, char, std::char_traits<char> >&, libtorrent::entry const&)': mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2f): undefined reference to libtorrent::entry::type() const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x78): undefined reference to libtorrent::entry::integer() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0xb3): undefined reference to libtorrent::entry::stringabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0xed): undefined reference to libtorrent::entry::string[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x128): undefined reference to libtorrent::entry::listabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x140): undefined reference to libtorrent::entry::list[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x1c9): undefined reference to libtorrent::entry::dictabi:cxx11 const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x1e1): undefined reference to libtorrent::entry::dict[abi:cxx11]() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2d3): undefined reference to libtorrent::entry::preformatted() const'
mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x2ea): undefined reference to libtorrent::entry::preformatted() const' mag2tor.cpp:(.text._ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE[_ZN10libtorrent6detail17bencode_recursiveISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_RKNS_5entryE]+0x317): undefined reference to libtorrent::entry::preformatted() const'
/tmp/cciTCjJL.o: In function int libtorrent::detail::write_integer<std::ostream_iterator<char, char, std::char_traits<char> > >(std::ostream_iterator<char, char, std::char_traits<char> >&, long)': mag2tor.cpp:(.text._ZN10libtorrent6detail13write_integerISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_l[_ZN10libtorrent6detail13write_integerISt16ostream_iteratorIccSt11char_traitsIcEEEEiRT_l]+0x37): undefined reference to libtorrent::detail::integer_to_str(char*, int, long)'
collect2: error: ld returned 1 exit status
: recipe for target 'mag2tor' failed
make: *** [mag2tor] Error 1
`

@xrgtn
Copy link
Owner

xrgtn commented Dec 3, 2017 via email

@xrgtn
Copy link
Owner

xrgtn commented Dec 4, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants