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

Make fails on Ubuntu 19.04 #12

Closed mialo5 closed 4 years ago

mialo5 commented 4 years ago

Hi

I tried to build the localproxy in Ubuntu and i keep getting the below failure message: " /usr/bin/ld: /usr/local/lib/libboost_log.a: error adding symbols: file in wrong format 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 "

I installed all the pre-requisites and didn't see that any of them failed. Any assistance would be much appreciated.

DavidOgunsAWS commented 4 years ago

Hi mialo5,

I haven't seen this exact error, but it looks like the linker that built "/usr/local/lib/libboost_log.a" is not compatible with the linker running the CMake build that produced the error. If you installed the Boost libraries via Ubuntu's package manage (apt), then CMake should be using the gcc toolchain installed via apt as well. Or you could have built the Boost libraries from source using any toolchain you've installed, but then you should ensure that CMake is built using the same one.

mialo5 commented 4 years ago

Hi

I had a look at the paths that CMAKE was specifying for the boost libraries and they all appeared to be correctly defined for boost v1.69. The gcc version is 8.3.0 on my ubuntu instance. I am not cross-compiling either. I couldn't specifically find what else the issue could be, do you perhaps have any idea where the linker conflict is?

DavidOgunsAWS commented 4 years ago

Hi mialo5,

It would be surprising, but possible that if you installed boost libraries via apt the library files are not compatible with the linker being used while building the localproxy. It's possible that you're linking to a 32 bit library while building a 64 bit executable or vice versa. To ensure this isn't happening, you can try building the boost libraries from source (1.68 or 1.69), and ensure both are using the same toolchain and architecture configuration (64 bit or 32 bit). This error should not occur if you have done this.

HarshGandhi-AWS commented 4 years ago

Hello mialo5,

I am closing this issue on behalf of David. Since we haven't heard back from you in a while, I assume that you have resolved your issue. If you are still facing any problem, please feel free to reopen this issue and I'll be happy to assist you. Thank you.