Hi all,
I am using this link to install the sample app but I receive the error that you can see.
Would you please help me to solve it.
pi@raspberrypi:~/iot-hub-c-raspberrypi-client-app $ sudo ./setup.sh --simulated-data
gcc version check pass (current:6.3.0,require:4.4.7)
cmake version check pass (current:3.7.2,require:2.8.12)
fatal: destination path 'wiringPi' already exists and is not an empty directory.
WiringPi Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
make: Nothing to be done for 'all'.
[Install Headers]
[Install Dynamic Lib]
GPIO Utility
make: Nothing to be done for 'all'.
[Install]
All Done.
NOTE: To compile programs with wiringPi, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).
Using simulated data
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/iot-hub-c-raspberrypi-client-app
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 tojson_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 tojson_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 tojson_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 tojson_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
p
Thanks
Regards
Hi @samanaz
Parson files are missing add parson.c,parson.h files
add those two files & compile again as shown below
/home/pi/Source/azure-iot-sdk-c/iothub_client/CMakeLists.txt file
set(iothub_client_c_files
./src/iothub_client.c
./src/iothub_client_core.c
./src/iothub_client_core_ll.c
./src/iothub_client_diagnostic.c
./src/iothub_client_ll.c
./src/iothub_device_client.c
./src/iothub_device_client_ll.c
./src/iothub_message.c
./src/iothubtransport.c
./src/version.c
../deps/parson/parson.c
)
set(iothub_client_h_files
./inc/iothub_client_core.h
./inc/iothub_client_core_ll.h
./inc/iothub_client.h
./inc/internal/iothub_client_common.h
./inc/iothub_client_ll.h
./inc/internal/iothub_client_diagnostic.h
./inc/iothub_client_options.h
./inc/internal/iothub_client_private.h
./inc/iothub_client_version.h
./inc/iothub_device_client.h
./inc/iothub_device_client_ll.h
./inc/iothub_transport_ll.h
./inc/iothub_message.h
./inc/internal/iothubtransport.h
../deps/parson/parson.h
)
@lakshmisivareddy
Hi lakshmisivareddy,
Thanks so much it helped to fix the issue.
Thanks again.
Hi @lakshmisivareddy
Is there any way to change and play with the codes of sample app that is running on Raspberry from Visual Studio 2017 Windows 10?
If you help me with that would be great.
Thanks so much
Regards,
Hi @samanaz
i haven't tried so far with visual studio . i will let you know if i try
Hi @lakshmisivareddy
It is better to ask my question like this.
What is the best IDE setup to write code for raspberry pi and azure IoT hub C SDK in this scenario for a starter?
Thanks.
Regards
Hi @samanaz ,
we usually map a folder from raspberry pi so we can edit the code, but build the solution using the compiler directly on the target device.
I have not tried it myself, but this article seems to show how to achieve what you are looking for:
https://visualgdb.com/tutorials/raspberry/
We will close this issue since the main question was resolved, but feel free to reopen it if you would like to follow up.
Thanks for using the Azure IoT SDKs!
@samanaz , thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey