Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22116

Azure IoT C SDK - library linking problem

$
0
0

I've created a simple application that uses the Azure IoT SDK for C to provision and connect to my Azure IoT Hub. This is cross-compiled using Debian for an ARM device.

This application builds and runs perfectly when I do a complete build of the SDK, because I developed my application based on one of the provided sample applications.

However, I would like to have my own custom build operation, with my own Makefile as below. I am linking in every .a library file that I get on the SDK, and also the required .so files on the target.My Makefile is as follows :

INC=-I./include/c-utility/inc -I./include/iothub_client/inc -I./include/serializer/inc -I./include/umqtt/inc -I./include/certificates -I./include/deps/umock-c/inc -I./include/deps/parson \-I./include/deps/azure-macro-utils-c/inc -I./include/provisioning_client/incSOURCE_DIR=./srcLIBS_DIR=./libsLIBS=-lrt -lgcc_s -lc -liothub_client -liothub_client_mqtt_transport -lprov_device_ll_client -lprov_device_client -luhttp -laziotsharedutil -lpthread -lcurl -lssl -lcrypto -lm  -luuid -lparson -lprov_mqtt_transport -lprov_http_transport -lprov_mqtt_ws_transport -lprov_auth_client \-liothub_client_mqtt_transport -lhsm_security_client -lumock_c -lumqtt -luamqp -lserializer -lprovisioning_service_client -lprov_mqtt_ws_transport -lprov_amqp_ws_transport -lprov_amqp_transport \-liothub_service_client -liothub_client_http_transport -liothub_client_amqp_ws_transport -liothub_client_amqp_transport -lhsm_security_client -lprov_device_ll_client -lcustom_hsm_exampleCC=/bin/arm-linux-gnueabi-gccCFLAGS= $(INC) -g -Wall -std=gnu99DEPS=default: runfilerunfile: custom_hsm_example.o prov_dev_client_sample.o     $(CC) $(CFLAGS) -o runfile custom_hsm_example.o prov_dev_client_sample.o -L$(LIBS_DIR) $(LIBS) custom_hsm_example.o: $(SOURCE_DIR)/custom_hsm_example.c    $(CC) $(CFLAGS) -c $(SOURCE_DIR)/custom_hsm_example.cprov_dev_client_sample.o: $(SOURCE_DIR)/prov_dev_client_sample.c    $(CC) $(CFLAGS) -c $(SOURCE_DIR)/prov_dev_client_sample.cclean:    rm -rf *.o runfile

Somehow the build still fails with the following linking problems. I don't think I am missing any libraries. Would the order of libraries listed in the Makefile matter? I'd appreciate any help. Here is the output when I invoke the Makefile.

/bin/arm-linux-gnueabi-gcc -I./include/c-utility/inc -I./include/iothub_client/inc -I./include/serializer/inc -I./include/umqtt/inc -I./include/certificates -I./include/deps/umock-c/inc -I./include/deps/parson -I./include/deps/azure-macro-utils-c/inc -I./include/provisioning_client/inc -g -Wall -std=gnu99 -o runfile custom_hsm_example.o prov_dev_client_sample.o -L./libs -lrt -lgcc_s -lc -liothub_client -liothub_client_mqtt_transport -lprov_device_ll_client -lprov_device_client -luhttp -laziotsharedutil -lpthread -lcurl -lssl -lcrypto -lm  -luuid -lparson -lprov_mqtt_transport -lprov_http_transport -lprov_mqtt_ws_transport -lprov_auth_client -liothub_client_mqtt_transport -lhsm_security_client -lumock_c -lumqtt -luamqp -lserializer -lprovisioning_service_client -lprov_mqtt_ws_transport -lprov_amqp_ws_transport -lprov_amqp_transport -liothub_service_client -liothub_client_http_transport -liothub_client_amqp_ws_transport -liothub_client_amqp_transport -lhsm_security_client -lprov_device_ll_client -lcustom_hsm_example ./libs/libprov_mqtt_transport.a(prov_transport_mqtt_client.c.o): In function `mqtt_transport_io':prov_transport_mqtt_client.c:(.text+0x84): undefined reference to `http_proxy_io_get_interface_description'./libs/libumqtt.a(mqtt_message.c.o): In function `mqttmessage_getTopicLevels':mqtt_message.c:(.text+0x96c): undefined reference to `StringToken_Split'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `prov_transport_challenge_callback':prov_device_ll_client.c:(.text+0x354): undefined reference to `prov_auth_import_key'prov_device_ll_client.c:(.text+0x3e4): undefined reference to `prov_auth_construct_sas_token'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `on_transport_registration_data':prov_device_ll_client.c:(.text+0x2348): undefined reference to `prov_auth_import_key'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `destroy_instance':prov_device_ll_client.c:(.text+0x28a4): undefined reference to `prov_auth_destroy'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `Prov_Device_LL_Create':prov_device_ll_client.c:(.text+0x2acc): undefined reference to `prov_auth_create'prov_device_ll_client.c:(.text+0x2be0): undefined reference to `prov_auth_get_type'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `Prov_Device_LL_Register_Device':prov_device_ll_client.c:(.text+0x2e8c): undefined reference to `prov_auth_get_registration_id'prov_device_ll_client.c:(.text+0x2fd4): undefined reference to `prov_auth_get_endorsement_key'prov_device_ll_client.c:(.text+0x3084): undefined reference to `prov_auth_get_storage_key'prov_device_ll_client.c:(.text+0x3158): undefined reference to `prov_auth_get_certificate'prov_device_ll_client.c:(.text+0x3208): undefined reference to `prov_auth_get_alias_key'./libs/libprov_device_ll_client.a(prov_device_ll_client.c.o): In function `Prov_Device_LL_SetOption':prov_device_ll_client.c:(.text+0x4120): undefined reference to `prov_auth_set_registration_id'collect2: error: ld returned 1 exit statusmake: *** [Makefile:17: runfile] Error 1

Viewing all articles
Browse latest Browse all 22116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>