iotkit-embedded
iotkit-embedded copied to clipboard
make sdk时出现undefined reference to `clock_gettime'
aua@AUA:~/aliIot/iotkit-embedded$ make SELECTED CONFIGURATION:
VENDOR : ubuntu MODEL : x86
CONFIGURE .............................. [sample] CONFIGURE .............................. [src/cmp] CONFIGURE .............................. [src/coap] CONFIGURE .............................. [src/cota] CONFIGURE .............................. [src/dm] CONFIGURE .............................. [src/fota] CONFIGURE .............................. [src/http] CONFIGURE .............................. [src/log] CONFIGURE .............................. [src/mqtt] CONFIGURE .............................. [src/ota] CONFIGURE .............................. [src/platform] CONFIGURE .............................. [src/sdk-tests] CONFIGURE .............................. [src/shadow] CONFIGURE .............................. [src/subdev] CONFIGURE .............................. [src/system] CONFIGURE .............................. [src/tfs] CONFIGURE .............................. [src/tls] CONFIGURE .............................. [src/utils]
BUILDING WITH EXISTING CONFIGURATION:
VENDOR : ubuntu MODEL : x86
Components:
. sample
. src/dm
. src/cmp
. src/http
. src/platform
. src/tls
. src/log
. src/system
. src/cota
. src/ota
. src/sdk-tests
. src/fota
. src/tfs
. src/shadow
. src/subdev
. src/mqtt
. src/coap
. src/utils
[CC] aes.o <= aes.c
makefile
[CC] asn1parse.o <= asn1parse.c
makefile
[CC] base64.o <= base64.c
makefile
[CC] bignum.o <= bignum.c
makefile
[CC] cipher.o <= cipher.c
makefile
[CC] cipher_wrap.o <= cipher_wrap.c
makefile
[CC] ctr_drbg.o <= ctr_drbg.c
makefile
[CC] debug.o <= debug.c
makefile
[CC] entropy.o <= entropy.c
makefile
[CC] entropy_poll.o <= entropy_poll.c
makefile
[CC] error.o <= error.c
makefile
[CC] md.o <= md.c
makefile
[CC] md_wrap.o <= md_wrap.c
makefile
[CC] net_sockets.o <= net_sockets.c
makefile
[CC] oid.o <= oid.c
makefile
[CC] pem.o <= pem.c
makefile
[CC] pk.o <= pk.c
makefile
[CC] pkparse.o <= pkparse.c
makefile
[CC] pk_wrap.o <= pk_wrap.c
makefile
[CC] platform.o <= platform.c
makefile
[CC] rsa.o <= rsa.c
makefile
[CC] sha1.o <= sha1.c
makefile
[CC] sha256.o <= sha256.c
makefile
[CC] ssl_ciphersuites.o <= ssl_ciphersuites.c
makefile
[CC] ssl_cli.o <= ssl_cli.c
makefile
[CC] ssl_cookie.o <= ssl_cookie.c
makefile
[CC] ssl_tls.o <= ssl_tls.c
makefile
[CC] timing.o <= timing.c
makefile
[CC] x509.o <= x509.c
makefile
[CC] x509_crt.o <= x509_crt.c
makefile
[AR] libiot_tls.a <= aes.o
asn1parse.o
base64.o
bignum.o
cipher.o
cipher_wrap.o
ctr_drbg.o
debug.o
entropy.o
entropy_poll.o
error.o
md.o
md_wrap.o
net_sockets.o
oid.o
pem.o
pk.o
pkparse.o
pk_wrap.o
platform.o
rsa.o
sha1.o
sha256.o
ssl_ciphersuites.o
ssl_cli.o
ssl_cookie.o
ssl_tls.o
timing.o
x509.o
x509_crt.o
[CC] HAL_OS_linux.o <= HAL_OS_linux.c
makefile
[CC] HAL_TCP_linux.o <= HAL_TCP_linux.c
makefile
[CC] HAL_UDP_linux.o <= HAL_UDP_linux.c
makefile
[CC] HAL_DTLS_mbedtls.o <= HAL_DTLS_mbedtls.c
makefile
[CC] HAL_TLS_mbedtls.o <= HAL_TLS_mbedtls.c
makefile
[CC] HAL_TLS_itls.o <= HAL_TLS_itls.c
makefile
[AR] libiot_platform.a <= HAL_OS_linux.o
HAL_TCP_linux.o
HAL_UDP_linux.o
HAL_DTLS_mbedtls.o
HAL_TLS_mbedtls.o
HAL_TLS_itls.o
[CC] utils_base64.o <= utils_base64.c
makefile
[CC] utils_hmac.o <= utils_hmac.c
makefile
[CC] utils_md5.o <= utils_md5.c
makefile
[CC] utils_sha1.o <= utils_sha1.c
makefile
[CC] utils_sha256.o <= utils_sha256.c
makefile
[CC] utils_epoch_time.o <= utils_epoch_time.c
makefile
[CC] utils_httpc.o <= utils_httpc.c
makefile
[CC] utils_list.o <= utils_list.c
makefile
[CC] utils_net.o <= utils_net.c
makefile
[CC] utils_timer.o <= utils_timer.c
makefile
[CC] json_parser.o <= makefile
[CC] json_token.o <= makefile
[CC] lite-utils_prog.o <= makefile
[CC] lite-utils_testsuite <= makefile
[CC] mem_stats.o <= makefile
[CC] string_utils.o <= makefile
[AR] libiot_utils.a <= utils_base64.o
utils_hmac.o
utils_md5.o
utils_sha1.o
utils_sha256.o
utils_epoch_time.o
utils_httpc.o
utils_list.o
utils_net.o
utils_timer.o
[CC] lite-log.o <= lite-log.c
makefile
[AR] libiot_log.a <= lite-log.o
[CC] ca.o <= ca.c
makefile
[CC] class_interface.o <= class_interface.c
makefile
[CC] device.o <= device.c
makefile
[CC] guider.o <= guider.c
makefile
[CC] id2_guider.o <= id2_guider.c
makefile
[CC] report.o <= report.c
makefile
[CC] sdk-impl.o <= sdk-impl.c
makefile
[AR] libiot_system.a <= ca.o
class_interface.o
device.o
guider.o
id2_guider.o
report.o
sdk-impl.o
[CC] mqtt_client.o <= mqtt_client.c
makefile
[CC] mqtt_instance.o <= mqtt_instance.c
makefile
[CC] MQTTConnectClient.o <= MQTTConnectClient.c
makefile
[CC] MQTTDeserializePubli <= MQTTDeserializePublish.c
makefile
[CC] MQTTPacket.o <= MQTTPacket.c
makefile
[CC] MQTTSerializePublish <= MQTTSerializePublish.c
makefile
[CC] MQTTSubscribeClient. <= MQTTSubscribeClient.c
makefile
[CC] MQTTUnsubscribeClien <= MQTTUnsubscribeClient.c
makefile
[AR] libiot_mqtt.a <= mqtt_client.o
mqtt_instance.o
MQTTConnectClient.o
MQTTDeserializePublish.o
MQTTPacket.o
MQTTSerializePublish.o
MQTTSubscribeClient.o
MQTTUnsubscribeClient.o
[CC] ota.o <= ota.c
makefile
[AR] libiot_ota.a <= ota.o
[CC] shadow.o <= shadow.c
makefile
[CC] shadow_common.o <= shadow_common.c
makefile
[CC] shadow_delta.o <= shadow_delta.c
makefile
[CC] shadow_update.o <= shadow_update.c
makefile
[AR] libiot_shadow.a <= shadow.o
shadow_common.o
shadow_delta.o
shadow_update.o
[CC] iotx_http_api.o <= iotx_http_api.c
makefile
[AR] libiot_http.a <= iotx_http_api.o
[CC] iotx_cmp_api.o <= iotx_cmp_api.c
makefile
[CC] iotx_cmp_cloud_conn. <= iotx_cmp_cloud_conn.c
makefile
[CC] iotx_cmp_common.o <= iotx_cmp_common.c
makefile
[CC] iotx_cmp_log.o <= iotx_cmp_log.c
makefile
[CC] iotx_cmp_mqtt_direct <= iotx_cmp_mqtt_direct.c
makefile
[CC] iotx_cmp_ota.o <= iotx_cmp_ota.c
makefile
[AR] libiot_cmp.a <= iotx_cmp_api.o
iotx_cmp_cloud_conn.o
iotx_cmp_common.o
iotx_cmp_log.o
iotx_cmp_mqtt_direct.o
iotx_cmp_ota.o
[CC] cJSON.o <= cJSON.c
makefile
[CC] cmp_abstract_impl.o <= cmp_abstract_impl.c
makefile
[CC] cmp_message_info.o <= cmp_message_info.c
makefile
[CC] dm_impl.o <= dm_impl.c
makefile
[CC] dm_thing.o <= dm_thing.c
makefile
[CC] dm_thing_manager.o <= dm_thing_manager.c
makefile
[CC] logger.o <= logger.c
makefile
[CC] single_list.o <= single_list.c
makefile
[AR] libiot_dm.a <= cJSON.o
cmp_abstract_impl.o
cmp_message_info.o
dm_impl.o
dm_thing.o
dm_thing_manager.o
logger.o
single_list.o
[CC] service_ota.o <= service_ota.c
makefile
[AR] libiot_fota.a <= service_ota.o
[CC] config_ota.o <= config_ota.c
makefile
[AR] libiot_cota.a <= config_ota.o
[AR] libiot_sdk.a <=
src/cmp/iotx_cmp_api.o
src/cmp/iotx_cmp_cloud_conn.o
src/cmp/iotx_cmp_common.o
src/cmp/iotx_cmp_log.o
src/cmp/iotx_cmp_mqtt_direct.o
src/cmp/iotx_cmp_ota.o
src/cota/config_ota.o
src/dm/cJSON.o
src/dm/cmp_abstract_impl.o
src/dm/cmp_message_info.o
src/dm/dm_impl.o
src/dm/dm_thing_manager.o
src/dm/dm_thing.o
src/dm/logger.o
src/dm/single_list.o
src/fota/service_ota.o
src/http/iotx_http_api.o
src/log/lite-log.o
src/mqtt/mqtt_client.o
src/mqtt/MQTTConnectClient.o
src/mqtt/MQTTDeserializePublish.o
src/mqtt/mqtt_instance.o
src/mqtt/MQTTPacket.o
src/mqtt/MQTTSerializePublish.o
src/mqtt/MQTTSubscribeClient.o
src/mqtt/MQTTUnsubscribeClient.o
src/ota/ota.o
src/shadow/shadow_common.o
src/shadow/shadow_delta.o
src/shadow/shadow.o
src/shadow/shadow_update.o
src/system/ca.o
src/system/class_interface.o
src/system/device.o
src/system/guider.o
src/system/id2_guider.o
src/system/report.o
src/system/sdk-impl.o
src/utils/json_parser.o
src/utils/json_token.o
src/utils/lite-utils_prog.o
src/utils/lite-utils_testsuites.o
src/utils/mem_stats.o
src/utils/string_utils.o
src/utils/utils_base64.o
src/utils/utils_epoch_time.o
src/utils/utils_hmac.o
src/utils/utils_httpc.o
src/utils/utils_list.o
src/utils/utils_md5.o
src/utils/utils_net.o
src/utils/utils_sha1.o
src/utils/utils_sha256.o
src/utils/utils_timer.o
[CC] mqtt-example.o <= mqtt-example.c
makefile
[LD] mqtt-example <= mqtt-example.o
/home/aua/aliIot/iotkit-embedded/.O/usr/lib/libiot_platform.a(HAL_OS_linux.o): In function HAL_UptimeMs': /home/aua/aliIot/iotkit-embedded/src/platform/os/ubuntu/HAL_OS_linux.c:116: undefined reference to
clock_gettime'
collect2: ld 返回 1
make[3]: *** [mqtt-example] 错误 1
make[2]: *** [mqtt-example] 错误 2
make[1]: *** [sample] 错误 2
make: *** [sub-mods] 错误 2
在 iot.mk 中增加LDFLAGS += -lrt
@yuanfeng5721 加在第几行, 我加在第5行后, LDFLAGS += -liot_platform 的下一行, 还是会报错undefined reference to `clock_gettime'
解决了吗?我也遇到了,求指引。 @yuanfeng5721 @wanghui0574xs