aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
74 stars 71 forks source link

Link symbol missing errors in Ubuntu 19.10 #14

Closed revmischa closed 4 years ago

revmischa commented 4 years ago
» make -j4 
[  7%] Linking CXX executable bin/localproxytest
[ 15%] Linking CXX executable bin/localproxy
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':
c_zlib.c:(.text+0x3b): undefined reference to `inflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_compress_block':
c_zlib.c:(.text+0xa4): undefined reference to `deflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_finish':
c_zlib.c:(.text+0xd9): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xe2): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_init':
c_zlib.c:(.text+0x1b5): undefined reference to `inflateInit_'
/usr/bin/ld: c_zlib.c:(.text+0x220): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_ctrl':
c_zlib.c:(.text+0x46c): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x5a4): undefined reference to `zError'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_write':
c_zlib.c:(.text+0x6a2): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x77c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x7eb): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_read':
c_zlib.c:(.text+0x8cc): undefined reference to `inflate'
/usr/bin/ld: c_zlib.c:(.text+0x96c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x9c4): undefined reference to `inflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_free':
c_zlib.c:(.text+0xa35): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xa60): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x1a8): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x272): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_load':
dso_dlfcn.c:(.text+0x2d8): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x349): undefined reference to `dlclose'
/usr/bin/ld: dso_dlfcn.c:(.text+0x385): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x441): undefined reference to `dladdr'
/usr/bin/ld: dso_dlfcn.c:(.text+0x4a6): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_unload':
dso_dlfcn.c:(.text+0x672): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/localproxytest.dir/build.make:176: bin/localproxytest] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/localproxytest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':
c_zlib.c:(.text+0x3b): undefined reference to `inflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_compress_block':
c_zlib.c:(.text+0xa4): undefined reference to `deflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_finish':
c_zlib.c:(.text+0xd9): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xe2): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_init':
c_zlib.c:(.text+0x1b5): undefined reference to `inflateInit_'
/usr/bin/ld: c_zlib.c:(.text+0x220): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_ctrl':
c_zlib.c:(.text+0x46c): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x5a4): undefined reference to `zError'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_write':
c_zlib.c:(.text+0x6a2): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x77c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x7eb): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_read':
c_zlib.c:(.text+0x8cc): undefined reference to `inflate'
/usr/bin/ld: c_zlib.c:(.text+0x96c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x9c4): undefined reference to `inflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_free':
c_zlib.c:(.text+0xa35): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xa60): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x1a8): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x272): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_load':
dso_dlfcn.c:(.text+0x2d8): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x349): undefined reference to `dlclose'
/usr/bin/ld: dso_dlfcn.c:(.text+0x385): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x441): undefined reference to `dladdr'
/usr/bin/ld: dso_dlfcn.c:(.text+0x4a6): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_unload':
dso_dlfcn.c:(.text+0x672): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/localproxy.dir/build.make:161: bin/localproxy] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/localproxy.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
DavidOgunsAWS commented 4 years ago

Hi Mischa,

Do you have the zlib development libraries installed? If you used Ubuntu's package manager, try downloading, building and installing from source instead. Some of the later errors suggest the localproxy isn't linking correctly to libc.

revmischa commented 4 years ago

I ran sudo apt remove zlib1g-dev zlibc Then built and installed zlib according to the README (it installed with sudo successfully) Now I get:

cmake ../
make

-- Boost version: 1.69.0
-- Found the following Boost libraries:
--   system
--   log
--   log_setup
--   thread
--   program_options
--   date_time
--   filesystem
--   regex
--   chrono
--   atomic
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cyber/dev/aws-iot-securetunneling-localproxy/build
[  7%] Linking CXX executable bin/localproxy
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':
c_zlib.c:(.text+0x3b): undefined reference to `inflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_compress_block':
c_zlib.c:(.text+0xa4): undefined reference to `deflate'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_finish':
c_zlib.c:(.text+0xd9): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xe2): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_init':
c_zlib.c:(.text+0x1b5): undefined reference to `inflateInit_'
/usr/bin/ld: c_zlib.c:(.text+0x220): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_ctrl':
c_zlib.c:(.text+0x46c): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x5a4): undefined reference to `zError'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_write':
c_zlib.c:(.text+0x6a2): undefined reference to `deflate'
/usr/bin/ld: c_zlib.c:(.text+0x77c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x7eb): undefined reference to `deflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_read':
c_zlib.c:(.text+0x8cc): undefined reference to `inflate'
/usr/bin/ld: c_zlib.c:(.text+0x96c): undefined reference to `zError'
/usr/bin/ld: c_zlib.c:(.text+0x9c4): undefined reference to `inflateInit_'
/usr/bin/ld: /usr/local/lib/libcrypto.a(c_zlib.o): in function `bio_zlib_free':
c_zlib.c:(.text+0xa35): undefined reference to `inflateEnd'
/usr/bin/ld: c_zlib.c:(.text+0xa60): undefined reference to `deflateEnd'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x1a8): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x272): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_load':
dso_dlfcn.c:(.text+0x2d8): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x349): undefined reference to `dlclose'
/usr/bin/ld: dso_dlfcn.c:(.text+0x385): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x441): undefined reference to `dladdr'
/usr/bin/ld: dso_dlfcn.c:(.text+0x4a6): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_unload':
dso_dlfcn.c:(.text+0x672): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/localproxy.dir/build.make:161: bin/localproxy] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/localproxy.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
HarshGandhi-AWS commented 4 years ago

Hello @revmischa ,

Thank you for your feedback, I am looking at this issue now. Some of the latter error messages suggest that the problem is with zlib library. If you have already installed the zlib library as per the instructions given in README file, I assume that the OpenSSL is not configured properly. Can you please tell me which version of OpenSSL you are using and how you installed it? And also verify if all of the other prerequisites are also installed correctly.

Thank you, Harsh Gandhi

HarshGandhi-AWS commented 4 years ago

Hello @revmischa , we haven’t heard back from you in quite some time, we will leave this issue open for another 7 days, if we haven’t heard back from you by then, we will close this issue. After that time, please feel free to open a new issue if you still face difficulties.