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)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/21/17 2:46 AM as a reply to Franjo Stjepandic.

Dear Franjo,

I have the same issue as well, currently the link is not avaliable.

http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.embedded-c.git/

So i tried using source and header file from following link 

https://github.com/eclipse/paho.mqtt.embedded-c

but no luck, it giving me the same error. Is there another site or link I can get the correct header and source? 

Thank you! 

0 (0 Votes)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/21/17 3:34 PM as a reply to Raheel Kasoo.

Hello Raheel,

apparently the link isn’t valid anymore, but you can use the header and source files from the github repository you linked, except the MQTTClient.c and MQTTClient.h files. Those files can be found in an older commit in the linked github repository. To get them, please download the content from the link here. It is the link to the old commit mentioned above.

With those files you should be able to use the MQTT Paho demo as intended.

Please let me know if this was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

+1 (1 Vote)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/29/17 7:20 AM as a reply to Franjo Stjepandic.

Hi Franjo,

I read this thread because I get the same error for the XDK Portal Demo but also with the MQTTClient.c and MQTTClient.h frome the older commit I still get some error most of them in this two files.

The errors are the following:
unknown type name 'Timer'    MQTTClient.c    /Bosch-XDK-Portal/source/paho    line 305    C/C++ Problem

unknown type name 'Network'    MQTTClient.c    /Bosch-XDK-Portal/source/paho    line 53    C/C++ Problem

Symbol 'SUCCESS' could not be resolved    MQTTClient.c    /Bosch-XDK-Portal/source/paho    line 45    Semantic Error

Symbol 'FAILURE' could not be resolved    MQTTClient.c    /Bosch-XDK-Portal/source/paho    line 32    Semantic Error

request for member 'mqttread' in something not a structure or union    MQTTClient.c    /Bosch-XDK-Portal/source/paho    line 89    C/C++ Problem

request for member 'disconnect' in something not a structure or union    bxpMqttClient.c    /Bosch-XDK-Portal/source    line 390    C/C++ Problem

Could you suggest a solution?

 

Martino

 

0 (0 Votes)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/29/17 2:37 PM as a reply to Martino Bruni.

Hello Martino,

Your project cannot build properly because an include is missing. Please open the file MQTTClient.h and in line 22 insert the following include:

#include "mqttXDK.h" //Platform specific implementation header file

Afterwards, your project should be able to build without any issues.

Please let me know if this was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

+1 (1 Vote)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/29/17 6:35 PM as a reply to Franjo Stjepandic.

Thanks Franjo for your answer.

With your solution now I can build without errors. Then I got the "Invalid Application" while flashing it but I soldved adding XDK Nature (as seen here) and now works.

Thank you for your availability,

Martino.

0 (0 Votes)
RE: MQTTPaho IBM IoT Makefile error
Answer
8/30/17 3:03 PM as a reply to Martino Bruni.

Hello Martino,

I glad to hear that you were able to make MQTT Paho demo work.

Please feel free to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)