Today, I redownloaded MQTT_Paho_latest.zip from https://xdk.bosch-connectivity.com/demos and  paho.mqtt.embedded-c-master.zip from https://github.com/eclipse/paho.mqtt.embedded-c. Follow tutorial "Getting Started Guide with MQTT(Paho Demo)" and forum instruction. (workbenck version 2.0.1)
 

Now the errors are:

'Client' could not be resolved mqttPahoClient.c and mqttPahoClient.h and Makefile

Description Resource Path Location Type
expected identifier or '(' before '&' token mqttPahoClient.c /MQTT_Paho/source line 190 C/C++ Problem
make\mingw32-make.exe[1]: *** [C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttButton.o] Error 1 MQTT_Paho    C/C++ Problem
make\mingw32-make.exe[1]: *** [C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttInit.o] Error 1 MQTT_Paho    C/C++ Problem
make\mingw32-make.exe[1]: *** [C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttPahoClient.o] Error 1 MQTT_Paho    C/C++ Problem
make\mingw32-make.exe[1]: *** No rule to make target 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/paho/MQTTClient.o', needed by 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/XDK_PAHO_DEMO.out'.  Stop. MQTT_Paho    C/C++ Problem
make\mingw32-make.exe[1]: *** Waiting for unfinished jobs.... MQTT_Paho    C/C++ Problem
mingw32-make: *** [debug] Error 2 MQTT_Paho    C/C++ Problem
recipe for target 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttButton.o' failed MQTT_Paho  line 80 C/C++ Problem
recipe for target 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttInit.o' failed MQTT_Paho  line 80 C/C++ Problem
recipe for target 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/mqttPahoClient.o' failed MQTT_Paho  line 80 C/C++ Problem
recipe for target 'debug' failed Makefile /MQTT_Paho line 50 C/C++ Problem
Type 'Client' could not be resolved mqttPahoClient.c /MQTT_Paho/source line 73 Semantic Error
Type 'Client' could not be resolved mqttPahoClient.h /MQTT_Paho/source line 54 Semantic Error
unknown type name 'Client' mqttPahoClient.c /MQTT_Paho/source line 73 C/C++ Problem
unknown type name 'Client' mqttPahoClient.h /MQTT_Paho/source line 54 C/C++ Problem
'buf' defined but not used [-Wunused-variable] mqttPahoClient.c /MQTT_Paho/source line 49 C/C++ Problem
'readbuf' defined but not used [-Wunused-variable] mqttPahoClient.c /MQTT_Paho/source line 50 C/C++ Problem

Any hint would be very much appreciated.

Ms. Zhu

0 (0 Votes)
RE: Type 'Client' could not be resolved mqttPahoClient.c, Makefile error
Answer
5/17/17 2:26 PM as a reply to Bochun Zhu.

Hello Bochun,

I was able to reproduce your issue. You have used MQTT paho implementation and header files from a wrong source https://github.com/eclipse/paho.mqtt.embedded-c. Therefore the shipped MQTTClient.h does not have have a declaration of the variable client which is required to build the MQTT paho demo without issues.

To solve this is issue, I recommend to download the MQTT paho implementation and header file from this source:

http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.embedded-c.git/
 
Copy and past the particular one as described in the getting started guide of the MQTT paho demo into your project source folder and then it should work without issues.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)
MQTTPaho IBM IoT Makefile error
Answer
5/18/17 5:14 AM as a reply to Franjo Stjepandic.

Thanks Franjo,

Finally no errors in source code, however still cannot compile, as Makefile has error in Line 50, no out, bin file generated. If comment off line 50, no out. no bin file generated.

Description Resource Path Location Type
make\mingw32-make.exe[1]: *** No rule to make target 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/objects/paho/MQTTClient.o', needed by 'C:/XDK-Workbench/workspace/MQTT_Paho/debug/XDK_PAHO_DEMO.out'.  Stop. MQTT_Paho    C/C++ Problem
make\mingw32-make.exe[1]: *** Waiting for unfinished jobs.... MQTT_Paho    C/C++ Problem
mingw32-make: *** [debug] Error 2 MQTT_Paho    C/C++ Problem
recipe for target 'debug' failed Makefile /MQTT_Paho line 50 C/C++ Problem

Any hint would be very much appreciated!

Ms. Zhu
 

0 (0 Votes)
RE: MQTTPaho IBM IoT Makefile error
Answer
5/18/17 3:33 PM as a reply to Bochun Zhu.

Hello Bochun,

I am glad to hear that you have no more errors in your source code.
I will reply to your new issue in you other thread.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)