Hello,
I am a newbie in Codeblocks. I have a little experience in c programming.
I try to compile the Paho Mqtt libary with codeblocks.
I get the followings Errormessages:
"cc -Wall -g -I../../paho.mqtt.c/src/samples -I/home/pi/paho.mqtt.c -I/home/pi/paho.mqtt.c/src/samples -c /home/pi/codeblock-projekt/MJ-Test/pubsub-mj.c -o obj/Debug/pubsub-mj.o
g++ -o bin/Debug/MJ-Test obj/Debug/pubsub-mj.o -lwiringPi ../../../../usr/local/lib/libpaho-mqtt3a.so ../../../../usr/local/lib/libpaho-mqtt3as.so ../../../../usr/local/lib/libpaho-mqtt3c.so ../../../../usr/local/lib/libpaho-mqtt3cs.so /usr/local/lib/libpaho-mqtt3a.so /usr/local/lib/libpaho-mqtt3as.so /usr/local/lib/libpaho-mqtt3c.so /usr/local/lib/libpaho-mqtt3cs.so /home/pi/paho.mqtt.c/build/output/libpaho-mqtt3a.so /home/pi/paho.mqtt.c/build/output/libpaho-mqtt3as.so /home/pi/paho.mqtt.c/build/output/libpaho-mqtt3c.so /home/pi/paho.mqtt.c/build/output/libpaho-mqtt3cs.so
/usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
2 error(s), 0 warning(s) (0 minute(s), 1 second(s)) "
I have read so many Internet articles but i can not find a solution.
I do not think that the Code is the problem but the Settings in codeblocks.
I hope everyone can help me.
Maybe it is a simple error for a expert.
Greetings Michael