Azure-Samples / iot-hub-c-raspberrypi-client-app

Application collects weather data from a BME280 sensor and sends it to IoT hub, also take actions according to cloud-to-device message, device management.
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-raspberry-pi-kit-c-get-started
MIT License
36 stars 34 forks source link

Build error #26

Closed hsolachu closed 6 years ago

hsolachu commented 6 years ago

After following the solution to #22 (checked all libraries in /usr/local/lib, copied internal folder from /home/pi/Source/azure-iot-sdk-c/iothub_client/inc to /usr/local/include/azureiot, added parson.h & parson.c), I ran into more errors shown below:

Scanning dependencies of target app [ 20%] Building C object CMakeFiles/app.dir/main.c.o [ 40%] Building C object CMakeFiles/app.dir/wiring.c.o [ 60%] Linking C executable app //usr/local/lib/libiothub_client.a(iothub_client_ll_uploadtoblob.c.o): In function 'IoTHubClient_LL_UploadToBlob_step1and2': iothub_client_ll_uploadtoblob.c:(.text+0x1018): undefined reference to 'json_parse_string' iothub_client_ll_uploadtoblob.c:(.text+0x1084): undefined reference to 'json_value_get_object' iothub_client_ll_uploadtoblob.c:(.text+0x10fc): undefined reference to 'json_object_get_string' iothub_client_ll_uploadtoblob.c:(.text+0x11e0): undefined reference to 'json_object_get_string' iothub_client_ll_uploadtoblob.c:(.text+0x1258): undefined reference to 'json_object_get_string' iothub_client_ll_uploadtoblob.c:(.text+0x12d0): undefined reference to 'json_object_get_string' iothub_client_ll_uploadtoblob.c:(.text+0x1348): undefined reference to 'json_object_get_string' iothub_client_ll_uploadtoblob.c:(.text+0x1818): undefined reference to 'json_value_free' collect2: error: ld returned 1 exit status CMakeFiles/app.dir/build.make:172: recipe for target 'app' failed make[2]: *** [app] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/app.dir/all' failed make[1]: *** [CMakeFiles/app.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

Any help would be appreciated. Thanks!

hsolachu commented 6 years ago

Resolved using @SLdragon's solution in #25