eclipse / paho.mqtt.c

An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS. API documentation: https://eclipse.github.io/paho.mqtt.c/
https://eclipse.org/paho
Other
1.94k stars 1.08k forks source link

cannot find MQTTClient_init: No such file or directory #1259

Closed Ybuzhenzhuo closed 1 year ago

Ybuzhenzhuo commented 2 years ago

Describe the bug arm-linux-gnueabihf-9.1.0-gcc :cannot find MQTTClient_init: No such file or directory

To Reproduce echo OSTYPE is Linux OSTYPE is Linux arm-linux-gnueabihf-9.1.0-gcc -g -fPIC -I/usr/local/src/openssl-1.1.1d/include/ -D_GNU_SOURCE -Os -Wall -fvisibility=hidden -Ibuild -DPAHO_MQTT_EXPORTS=1 -o build/output/libpaho-mqtt3c.so.1.3 src/Heap.c src/Socket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/MQTTPersistenceDefault.c src/MQTTTime.c src/MQTTPacketOut.c src/Thread.c src/WebSocket.c src/Clients.c src/OsWrapper.c src/MQTTPacket.c src/Messages.c src/MQTTPersistence.c src/Base64.c src/SHA1.c src/Log.c src/StackTrace.c src/LinkedList.c src/MQTTReasonCodes.c src/utf-8.c src/MQTTProperties.c src/SocketBuffer.c src/Proxy.c src/Tree.c src/MQTTClient.c -L/usr/local/lib -Wl,-rpath -L/usr/local/lib/ -shared -Wl,-init,MQTTClient_init -Wl,--start-group -pthread -lanl -Wl,--end-group -Wl,-soname,libpaho-mqtt3c.so.1 /opt/hisi-linux/x86-arm/gcc-sigmastar-9.1.0-2019.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/9.1.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find MQTTClient_init: No such file or directory

Expected behavior Normal compilation.

Environment (please complete the following information):

Additional context Previous normal compilation. There are the following operations.

sudo apt purge binutils sudo apt remove make sudo apt autoremove sudo apt install build-essential sudo apt-get install lib32stdc++6 sudo apt-get install lib32z1

arm-gcc and makefile have not changed.

icraggs commented 2 years ago

MQTTClient_init was never intended to be called by an application. You can call MQTTClient_global_init if you need to but it's not required unless you need to change default behaviour.

icraggs commented 1 year ago

Answered.