How to for cross compiling Paho-MQTT C library for ARM platform.
Here are the steps I followed.
1) Downloaded library from [https://github.com/eclipse/paho.mqtt.embedded-c][here]
2) after download, I opened the directory and entered some commands.
3) command for setting the GCC-ARM tool chain (environment variable_path)
4) make CC=(ARM-CROSS_COMPILE)gcc
Next, I observe following error
mkdir -p build/output/samples
mkdir -p build/output/test
echo OSTYPE is Linux
OSTYPE is Linux
sed -e "s/@CLIENT_VERSION@/1.2.0/g" -e "s/@BUILD_TIMESTAMP@/Mon Apr 16 17:13:10 IST 2018/g" src/VersionInfo.h.in > build/VersionInfo.h
arm-cortexa9-linux-gnueabihf-gcc -g -fPIC -Os -Wall -fvisibility=hidden -Ibuild -o build/output/libpaho-mqtt3c.so.1.0 src/MQTTPersistence.c src/Heap.c src/Socket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/StackTrace.c src/MQTTPersistenceDefault.c src/MQTTClient.c src/Messages.c src/MQTTPacketOut.c src/Clients.c src/OsWrapper.c src/Thread.c src/MQTTPacket.c src/Log.c src/LinkedList.c src/utf-8.c src/SocketBuffer.c src/Tree.c -shared -Wl,-init,MQTTClient_init -lpthread -Wl,-soname,libpaho-mqtt3c.so.1
ln -s libpaho-mqtt3c.so.1.0 build/output/libpaho-mqtt3c.so.1
ln -s libpaho-mqtt3c.so.1 build/output/libpaho-mqtt3c.so
arm-cortexa9-linux-gnueabihf-gcc -g -fPIC -Os -Wall -fvisibility=hidden -Ibuild -o build/output/libpaho-mqtt3cs.so.1.0 src/MQTTPersistence.c src/Heap.c src/Socket.c src/SSLSocket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/StackTrace.c src/MQTTPersistenceDefault.c src/MQTTClient.c src/Messages.c src/MQTTPacketOut.c src/Clients.c src/OsWrapper.c src/Thread.c src/MQTTPacket.c src/Log.c src/LinkedList.c src/utf-8.c src/SocketBuffer.c src/Tree.c -DOPENSSL -shared -Wl,--start-group -lpthread -ldl -lssl -lcrypto -Wl,--end-group -Wl,-init,MQTTClient_init -Wl,-soname,libpaho-mqtt3cs.so.1 -Wl,-no-whole-archive
In file included from src/MQTTPersistence.h:23:0,
from src/MQTTPersistence.c:28:
src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/Socket.c:32:0:
src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/SSLSocket.c:31:0:
src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPacket.h:25:0,
from src/MQTTProtocolClient.h:25,
from src/MQTTProtocolClient.c:34:
src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPacket.h:25:0,
from src/MQTTProtocolOut.h:24,
from src/MQTTProtocolOut.c:35:
src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/StackTrace.c:21:0:
src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPersistence.h:23:0,
from src/MQTTClient.c:53:
src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPacket.h:25:0,
from src/MQTTPacketOut.h:22,
from src/MQTTPacketOut.c:29:
src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/Clients.c:24:0:
src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPacket.h:25:0,
from src/MQTTPacket.c:26:
src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/MQTTPacket.h:25:0,
from src/Log.c:27:
src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
In file included from src/SocketBuffer.c:25:0:
src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
Makefile:219: recipe for target 'build/output/libpaho-mqtt3cs.so.1.0' failed
make: *** [build/output/libpaho-mqtt3cs.so.1.0] Error 1
4) I installed openssl using this command
$ sudo apt-get install libssl-dev*
Openssl installed successfully, but still getting the same above error .
What I have to do for compiling Paho-MQTT-C library for ARM?