Community news, upcoming events and general discussions
Threads: 29 Posts: 76
Get technical support from the community
Threads: 838 Posts: 4534
Threads: 15 Posts: 54
Tell us how to make XDK better!
Threads: 34 Posts: 112
Share and discuss community member projects
Threads: 32 Posts: 155
I followed the guide "Cross Domain Development Kit XDK110 Platform for Application Development", however SUCCESS, FAILURE couldn't be resolved in MQTTClient.c.
Any solution to it? teh workbench ver is v2.0.0
this issue occurs, because the marked variable is not uniquely namely declared and therefore the linker of the XDK Workbench finds references to SUCCESS and FAILURE in other interfaces and implementation files, in which a variable with the same name is declared. Therefore the error symbol cannot be resolved appears.
But this happens only, because the linker is unable to resolve the variable. If the compiler of the XDK Workbench can build the project without errors, then the project should work without issues on the XDK.
There are three options available to solve this. Option one would be to define the two unresolvable variables in the header file MQTTClient.h in the following pattern and to delete them in the enumeration returnCode.
#define SUCCESS 0
#define FAILURE -1
Option two would be to move the complete returnCode enumeration to the beginning of the implementation file MQTTClient.c beneath #include "MQTTClient.h".
And the last option would be to rename both variables to unique names, so that the linker won't find any similar variable references in other files. In this case, you will have to rename them in the header MQTTClient.h as well as in the MQTTClient.c. The XDK Workbench offers the possibility of quick refactoring, by rightclicking the variable name, selecting Refactor > Rename, and typing a new name.
Please tell me if this is helpful and do not hesitate to ask if you have further questions.
Kind regards, Franjo
Thank you Franjo,
After using option 2, the error for SUCCESS and FAILURE gone. But build project still encounter problems:
1. Under Console window:
Makefile:50: recipe for target 'debug' failed mingw32-make: *** [debug] Error 2
2. Under Problems window:
A) make\mingw32-make.exe: *** No rule to make target 'C:/XDK-Workbench1_5_2/workspace/MQTT_Paho_RELEASEv0.1.1/debug/objects/paho/MQTTClient.o', needed by 'C:/XDK-Workbench1_5_2/workspace/MQTT_Paho_RELEASEv0.1.1/debug/XDK_PAHO_DEMO.out'. Stop. MQTT_Paho_RELEASEv0.1.1 C/C++ Problem:
B) make\mingw32-make.exe: *** Waiting for unfinished jobs.... MQTT_Paho_RELEASEv0.1.1 C/C++ Problem
C) mingw32-make: *** [debug] Error 2 MQTT_Paho_RELEASEv0.1.1 C/C++ Problem
D) recipe for target 'debug' failed Makefile /MQTT_Paho_RELEASEv0.1.1 line 50 C/C++ Problem
Appreciated any advice in advance!
I am glad to hear that you were able to solve the issue.
I will reply to the makefile issue in this thread.
Please do not hesitate to ask if you have further questions.