Not a dynamic executable in the cross-compilation environment

Problem introduction: compile the previously written MQTTserver.so plan into arm series so. But after the completion of the compilation, the problem of not a dynamic executable appeared.

Solution: The
first step is to recompile the libpaho-mqtt3c.so.1.0 file. When compiling this file, change the gcc cross-compilation to arm-linux-gnueabihf-gcc in the source code location to compile and generate a new libpaho-mqtt3c .so.1.0 file. Finally, when compiling mqttserver.so, put the newly generated libpaho-mqtt3c.so.1.0 file and compile it, then the newly compiled mqttserver.so can be used, you can check it through the ldd command . My view information is displayed as follows:
root@raspberrypi:/home/dap/system/protocol# ldd dapmqttserver.so
linux-vdso.so.1 (0xbeed4000)
/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM }.so => ​​/usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6f25000)
libpaho-mqtt3c.so.1 => /home/dap/system/libpaho-mqtt3c.so.1 (0xb6e86000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6e59000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d0b000)
libpthread. so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6ce1000)
/lib/ld-linux-armhf.so.3 (0xb6f3c000)

Guess you like

Origin blog.csdn.net/weixin_44881103/article/details/115325019