Azure-Samples / iot-hub-c-thingdev-getstartedkit

Get started with The Sparkfun Thingdev Azure IoT Starter Kit
MIT License
12 stars 15 forks source link

command_center.ino fails to compile #25

Open chriskm opened 7 years ago

chriskm commented 7 years ago

When I try to compile command_center.ino, it fails to compile and outputs following error message:

"C:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023\libraries\DHT_sensor_library\DHT_U.cpp.o" "C:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023/arduino.ar" -lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 -llwip_gcc -lstdc++ -Wl,--end-group "-LC:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023" C:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023\sketch\command_center_http.c.o:(.text.sendCallback+0x14): undefined reference to `IOTHUB_CLIENT_CONFIRMATION_RESULTStrings'

C:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023\sketch\command_center_http.c.o: In function `sendCallback':

C:\Users\vgw51464\AppData\Local\Temp\arduino_build_863023\sketch/command_center_http.c:94: undefined reference to `IOTHUB_CLIENT_CONFIRMATION_RESULTStrings'

collect2.exe: error: ld returned 1 exit status

Using library ESP8266WiFi at version 1.0 in folder: C:\Users\vgw51464\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi Using library AzureIoTHub at version 0.2.0 in folder: C:\Users\vgw51464\Documents\Arduino\libraries\AzureIoTHub Using library Adafruit_Sensor-master at version 1.0.2 in folder: C:\Users\vgw51464\Documents\Arduino\libraries\Adafruit_Sensor-master Using library DHT_sensor_library at version 1.3.0 in folder: C:\Users\vgw51464\Documents\Arduino\libraries\DHT_sensor_library exit status 1 Error compiling for board SparkFun ESP8266 Thing Dev.

jirkakoutny commented 7 years ago

sketch/command_center_http.c.o:(.text.sendCallback+0x14): undefined reference to IOTHUB_CLIENT_CONFIRMATION_RESULTStrings' sketch/command_center_http.c.o: In functionsendCallback': sketch/command_center_http.c:94: undefined reference to `IOTHUB_CLIENT_CONFIRMATION_RESULTStrings' collect2: error: ld returned 1 exit status exit status 1 Nastala chyba při kompilaci u desky SparkFun ESP8266 Thing Dev.

jirkakoutny commented 7 years ago

command_center.c:173: error: 'MQTT_Protocol' undeclared (first use in this function) IOTHUB_CLIENT_LL_HANDLE iotHubClientHandle = IoTHubClient_LL_CreateFromConnectionString(connectionString, MQTT_Protocol); ^ sketch/command_center.c:173:115: note: each undeclared identifier is reported only once for each function it appears in exit status 1 'MQTT_Protocol' undeclared (first use in this function)

mamokarz commented 7 years ago

Please update your AzureIoT library.

  1. Delete the old AzureIoTHub from Arduino/libraries directory
  2. Install the new AzureIoTHub, AzureIoTUtility, and AzureIoTProtocol_MQTT, all on version 1.0.17
  3. Update all other libraries, including the esp8266 by ESP8266 Community in the 'Boards Manager' that must be version 2.3.0

Localize the target directory, Were Arduino IDE is placing the ino.elf file, it is probably in the C:\Users\\AppData\Local\Temp, you should have a directory called arduinobuild or only build_... Once you localize it, delete all files inside of this directory.

Build again your ino file.

jirkakoutny commented 7 years ago

OK, thanks for your reply, it helps and now it works for me on Win10. However, on macOS Sierra it still fails on this:

In file included from /Users/jirka/Documents/Arduino/libraries/AzureIoTUtility/src/azure_c_shared_utility/xlogging.h:57:0, from /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/sdk/serializer.h:58, from /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/AzureIoTHub.h:9, from /Users/jirka/Documents/Projects/temp/iot-hub-c-thingdev-getstartedkit/command_center/command_center.ino:9: /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/esp8266/azcpgmspace.h:15:53: fatal error: azure_c_shared_utility\crt_abstractions.h: No such file or directory

include "azure_c_shared_utility\crt_abstractions.h"

                                                 ^

compilation terminated. exit status 1 Nastala chyba při kompilaci u desky SparkFun ESP8266 Thing Dev.

jirkakoutny commented 7 years ago

The same problem is in the simlpesample_http example:

In file included from /Users/jirka/Documents/Arduino/libraries/AzureIoTUtility/src/azure_c_shared_utility/xlogging.h:57:0, from /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/sdk/serializer.h:58, from /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/AzureIoTHub.h:9, from /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/examples/simplesample_http/simplesample_http.ino:42: /Users/jirka/Documents/Arduino/libraries/AzureIoTHub/src/esp8266/azcpgmspace.h:15:53: fatal error: azure_c_shared_utility\crt_abstractions.h: No such file or directory

include "azure_c_shared_utility\crt_abstractions.h"

                                                 ^

compilation terminated. exit status 1 Nastala chyba při kompilaci u desky SparkFun ESP8266 Thing Dev.

NoahNOA commented 7 years ago

@jirkakoutny In case you didn't figure it out, it's because he's using backslashes in his absolute paths. Can hardly blame an MS employee for being Windows-centric. Edit the library files in question and replace the offending character with a proper slash. Done and done.

jirkakoutny commented 7 years ago

@NoahNOA THX! I did not notice it myself, thanks again.