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

Errors compiling using build.sh in folder examples++ #78

Open
bignmllc opened this issue Oct 5, 2021 · 0 comments
Open

Errors compiling using build.sh in folder examples++ #78

bignmllc opened this issue Oct 5, 2021 · 0 comments

Comments

@bignmllc
Copy link

bignmllc commented Oct 5, 2021

Creates the following problems with gcc v9:

./build.sh
/tmp/ccpXA2pb.o: In function run_client()': dgram_over_stream.cpp:(.text+0x266): undefined reference to libsocket::inet_stream::inet_stream(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)'
dgram_over_stream.cpp:(.text+0x27e): undefined reference to libsocket::socket::socket(libsocket::socket&&)' dgram_over_stream.cpp:(.text+0x2a6): undefined reference to libsocket::dgram_over_stream::dgram_over_stream(libsocket::stream_client_socket)'
dgram_over_stream.cpp:(.text+0x2c1): undefined reference to libsocket::socket::~socket()' dgram_over_stream.cpp:(.text+0x2d8): undefined reference to libsocket::dgram_over_stream::sndmsg(void const*, unsigned long)'
dgram_over_stream.cpp:(.text+0x301): undefined reference to libsocket::dgram_over_stream::rcvmsg(void*, unsigned long)' dgram_over_stream.cpp:(.text+0x408): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function run_string_client()': dgram_over_stream.cpp:(.text+0x4b6): undefined reference to libsocket::inet_stream::inet_stream(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)'
dgram_over_stream.cpp:(.text+0x4d4): undefined reference to libsocket::socket::socket(libsocket::socket&&)' dgram_over_stream.cpp:(.text+0x4fc): undefined reference to libsocket::dgram_over_stream::dgram_over_stream(libsocket::stream_client_socket)'
dgram_over_stream.cpp:(.text+0x51c): undefined reference to libsocket::socket::~socket()' dgram_over_stream.cpp:(.text+0x57a): undefined reference to libsocket::dgram_over_stream::sndmsg(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
dgram_over_stream.cpp:(.text+0x5af): undefined reference to libsocket::dgram_over_stream::rcvmsg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' dgram_over_stream.cpp:(.text+0x69d): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function run_server()': dgram_over_stream.cpp:(.text+0x76a): undefined reference to libsocket::inet_stream_server::inet_stream_server(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)'
dgram_over_stream.cpp:(.text+0x77d): undefined reference to libsocket::inet_stream_server::accept(int, int)' dgram_over_stream.cpp:(.text+0x794): undefined reference to libsocket::socket::socket(libsocket::socket&&)'
dgram_over_stream.cpp:(.text+0x7bc): undefined reference to libsocket::dgram_over_stream::dgram_over_stream(libsocket::stream_client_socket)' dgram_over_stream.cpp:(.text+0x7d7): undefined reference to libsocket::socket::~socket()'
dgram_over_stream.cpp:(.text+0x800): undefined reference to libsocket::dgram_over_stream::rcvmsg(void*, unsigned long)' dgram_over_stream.cpp:(.text+0x8ba): undefined reference to libsocket::dgram_over_stream::sndmsg(void const*, unsigned long)'
/tmp/ccpXA2pb.o: In function run_vec_client()': dgram_over_stream.cpp:(.text+0x974): undefined reference to libsocket::inet_stream::inet_stream(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int, int)'
dgram_over_stream.cpp:(.text+0x992): undefined reference to libsocket::socket::socket(libsocket::socket&&)' dgram_over_stream.cpp:(.text+0x9bd): undefined reference to libsocket::dgram_over_stream::dgram_over_stream(libsocket::stream_client_socket)'
dgram_over_stream.cpp:(.text+0x9d9): undefined reference to libsocket::socket::~socket()' dgram_over_stream.cpp:(.text+0xa31): undefined reference to libsocket::dgram_over_stream::sndmsg(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
dgram_over_stream.cpp:(.text+0xa66): undefined reference to libsocket::dgram_over_stream::rcvmsg(std::vector<unsigned char, std::allocator<unsigned char> >*)' dgram_over_stream.cpp:(.text+0xb76): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function libsocket::stream_client_socket::~stream_client_socket()': dgram_over_stream.cpp:(.text._ZN9libsocket20stream_client_socketD1Ev[_ZN9libsocket20stream_client_socketD1Ev]+0x13): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function virtual thunk to libsocket::stream_client_socket::~stream_client_socket()': dgram_over_stream.cpp:(.text._ZN9libsocket20stream_client_socketD1Ev[_ZN9libsocket20stream_client_socketD1Ev]+0x3a): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function libsocket::stream_client_socket::~stream_client_socket()': dgram_over_stream.cpp:(.text._ZN9libsocket20stream_client_socketD0Ev[_ZN9libsocket20stream_client_socketD0Ev]+0x18): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o: In function virtual thunk to libsocket::stream_client_socket::~stream_client_socket()': dgram_over_stream.cpp:(.text._ZN9libsocket20stream_client_socketD0Ev[_ZN9libsocket20stream_client_socketD0Ev]+0x4e): undefined reference to libsocket::socket::~socket()'
/tmp/ccpXA2pb.o:dgram_over_stream.cpp:(.text._ZN9libsocket11inet_streamD0Ev[_ZN9libsocket11inet_streamD0Ev]+0x4e): more undefined references to libsocket::socket::~socket()' follow /tmp/ccpXA2pb.o:(.rodata._ZTIN9libsocket20stream_client_socketE[_ZTIN9libsocket20stream_client_socketE]+0x18): undefined reference to typeinfo for libsocket::socket'
/tmp/ccpXA2pb.o:(.rodata._ZTIN9libsocket11inet_socketE[_ZTIN9libsocket11inet_socketE]+0x18): undefined reference to typeinfo for libsocket::socket' /tmp/ccpXA2pb.o:(.rodata._ZTVN9libsocket20stream_client_socketE[_ZTVN9libsocket20stream_client_socketE]+0x58): undefined reference to libsocket::socket::destroy()'
/tmp/ccpXA2pb.o:(.rodata._ZTCN9libsocket11inet_streamE80_NS_20stream_client_socketE[_ZTVN9libsocket11inet_streamE]+0x58): undefined reference to libsocket::socket::destroy()' /tmp/ccpXA2pb.o:(.rodata._ZTCN9libsocket11inet_streamE0_NS_11inet_socketE[_ZTVN9libsocket11inet_streamE]+0x58): undefined reference to libsocket::socket::destroy()'
/tmp/ccpXA2pb.o:(.rodata._ZTVN9libsocket11inet_streamE[_ZTVN9libsocket11inet_streamE]+0x80): undefined reference to libsocket::socket::destroy()' /tmp/ccpXA2pb.o:(.rodata._ZTCN9libsocket18inet_stream_serverE0_NS_11inet_socketE[_ZTVN9libsocket18inet_stream_serverE]+0x58): undefined reference to libsocket::socket::destroy()'
/tmp/ccpXA2pb.o:(.rodata._ZTVN9libsocket18inet_stream_serverE[_ZTVN9libsocket18inet_stream_serverE]+0x58): more undefined references to libsocket::socket::destroy()' follow collect2: error: ld returned 1 exit status /tmp/cc3potW2.o: In function main':
framing.cpp:(.text.startup+0x2b): undefined reference to libsocket::encode_uint32(unsigned int, char*)' framing.cpp:(.text.startup+0x35): undefined reference to libsocket::decode_uint32(char const*)'
collect2: error: ld returned 1 exit status
/tmp/ccUUZQym.o: In function libsocket::unix_dgram_client::~unix_dgram_client()': unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD1Ev[_ZN9libsocket17unix_dgram_clientD1Ev]+0x37): undefined reference to libsocket::socket::~socket()'
/tmp/ccUUZQym.o: In function non-virtual thunk to libsocket::unix_dgram_client::~unix_dgram_client()': unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD1Ev[_ZN9libsocket17unix_dgram_clientD1Ev]+0x77): undefined reference to libsocket::socket::~socket()'
/tmp/ccUUZQym.o: In function virtual thunk to libsocket::unix_dgram_client::~unix_dgram_client()': unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD1Ev[_ZN9libsocket17unix_dgram_clientD1Ev]+0xbe): undefined reference to libsocket::socket::~socket()'
/tmp/ccUUZQym.o: In function non-virtual thunk to libsocket::unix_dgram_client::~unix_dgram_client()': unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD0Ev[_ZN9libsocket17unix_dgram_clientD0Ev]+0x40): undefined reference to libsocket::socket::~socket()'
/tmp/ccUUZQym.o: In function virtual thunk to libsocket::unix_dgram_client::~unix_dgram_client()': unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD0Ev[_ZN9libsocket17unix_dgram_clientD0Ev]+0xa2): undefined reference to libsocket::socket::~socket()'
/tmp/ccUUZQym.o:unix_dgram_syslogclient.cpp:(.text._ZN9libsocket17unix_dgram_clientD0Ev[_ZN9libsocket17unix_dgram_clientD0Ev]+0xfb): more undefined references to libsocket::socket::~socket()' follow /tmp/ccUUZQym.o: In function main':
unix_dgram_syslogclient.cpp:(.text.startup+0x61): undefined reference to libsocket::unix_dgram_client::unix_dgram_client(int)' unix_dgram_syslogclient.cpp:(.text.startup+0x75): undefined reference to libsocket::unix_dgram::sndto(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)'
unix_dgram_syslogclient.cpp:(.text.startup+0x7f): undefined reference to libsocket::socket::destroy()' /tmp/ccUUZQym.o:(.rodata._ZTIN9libsocket19dgram_client_socketE[_ZTIN9libsocket19dgram_client_socketE]+0x18): undefined reference to typeinfo for libsocket::socket'
/tmp/ccUUZQym.o:(.rodata._ZTIN9libsocket11unix_socketE[_ZTIN9libsocket11unix_socketE]+0x18): undefined reference to typeinfo for libsocket::socket' /tmp/ccUUZQym.o:(.rodata._ZTCN9libsocket17unix_dgram_clientE40_NS_19dgram_client_socketE[_ZTVN9libsocket17unix_dgram_clientE]+0x58): undefined reference to libsocket::socket::destroy()'
/tmp/ccUUZQym.o:(.rodata._ZTCN9libsocket17unix_dgram_clientE0_NS_11unix_socketE[_ZTVN9libsocket17unix_dgram_clientE]+0x58): undefined reference to libsocket::socket::destroy()' /tmp/ccUUZQym.o:(.rodata._ZTCN9libsocket17unix_dgram_clientE0_NS_10unix_dgramE[_ZTVN9libsocket17unix_dgram_clientE]+0x58): undefined reference to libsocket::socket::destroy()'
/tmp/ccUUZQym.o:(.rodata._ZTVN9libsocket17unix_dgram_clientE[_ZTVN9libsocket17unix_dgram_clientE]+0x80): undefined reference to `libsocket::socket::destroy()'
collect2: error: ld returned 1 exit status

Fix: Put the -lsocket++ at the end of the g++ compiler lines, not in front of the source names.

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

1 participant