aos-cube version: 0.5.7 Check if required tools for stm32f103rb-nucleo exist ECHO 处于关闭状态。 Build Configuration:
App: mqtt_demo Board: stm32f103rb-nucleo
ECHO 处于关闭状态。 Build AOS Now TOOLCHAIN_PATH= Making mqtt_demo@stm32f103rb-nucleo.elf out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function IOT_MQTT_Construct': D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:153: undefined reference to
IOT_Ioctl' D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:156: undefined reference to IOT_Ioctl' D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:360: undefined reference to
wrapper_mqtt_init' D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:366: undefined reference to wrapper_mqtt_connect' D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:370: undefined reference to
wrapper_mqtt_release' D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:381: undefined reference to iotx_event_callback' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function
IOT_MQTT_Destroy': D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:403: undefined reference to wrapper_mqtt_release' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function
IOT_MQTT_Yield': D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:412: undefined reference to wrapper_mqtt_yield' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function
IOT_MQTT_CheckStateNormal': D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:424: undefined reference to wrapper_mqtt_check_state' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function
IOT_MQTT_Subscribe':
D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:447: undefined reference to wrapper_mqtt_subscribe' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_mqtt.a(mqtt_api.o): In function
IOT_MQTT_Publish_Simple':
D:\AliOS-Things/components/linkkit/mqtt/mqtt_api.c:525: undefined reference to wrapper_mqtt_publish' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_wrappers.a(HAL_PRODUCT_rhino.o): In function
HAL_GetDeviceSecret': D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:179: undefined reference to infra_aes128_init' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:184: undefined reference to
infra_aes128_cfb_decrypt' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:185: undefined reference to infra_aes128_destroy' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_wrappers.a(HAL_PRODUCT_rhino.o): In function
HAL_SaveDeviceIdentity': D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:213: undefined reference to infra_aes128_init' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:240: undefined reference to
infra_aes128_init' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:219: undefined reference to infra_aes128_cfb_encrypt' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:220: undefined reference to
infra_aes128_destroy' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:246: undefined reference to infra_aes128_cfb_encrypt' D:\AliOS-Things/components/linkkit/wrappers/os/HAL_PRODUCT_rhino.c:247: undefined reference to
infra_aes128_destroy' out/mqtt_demo@stm32f103rb-nucleo/libraries/libiot_sign.a(dev_sign_mqtt.o): In function _iotx_generate_sign_string': D:\AliOS-Things/components/linkkit/dev_sign/dev_sign_mqtt.c:143: undefined reference to
utils_hmac_sha256'
collect2.exe: error: ld returned 1 exit status make.exe[1]: *** [build/build_rules/aos_target_build.mk:294: out/mqtt_demo@stm32f103rb-nucleo/binary/mqtt_demo@stm32f103rb-nucleo.elf] Error 1 make: *** [build\Makefile:415: main_app] Error 2
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
遇到这些“undefined reference”错误通常意味着链接器在尝试构建目标文件时找不到某些函数的定义。这可能是因为相关的库或对象文件没有正确地链接到项目中,或者这些函数的实现确实不存在于预期的位置。针对您提供的AliOS-Things构建错误,以下是一些建议来解决这些问题:
检查依赖关系:确保所有需要的库和源文件都已正确添加到您的项目中。特别是那些报错中提到的函数(如IOT_Ioctl
, wrapper_mqtt_init
, utils_hmac_sha256
等)所在的库是否已经包含并正确配置。
查看编译选项与路径:确认您的编译命令或Makefile中的TOOLCHAIN_PATH
、LIBRARY_PATH
或类似变量是否设置正确,以指向包含了所有必要库的目录。
链接顺序与库:有时候,链接器需要按照特定的顺序来处理库文件。如果一个库依赖于另一个库中的符号,则需确保依赖的库先被链接。检查并调整您的链接命令或Makefile中的库链接顺序。
重新生成依赖关系:有些情况下,项目的依赖关系可能因为某些原因变得不准确。您可以尝试清理并重新生成所有的依赖关系文件(通常是.d
文件),然后重新构建。
检查组件更新:确保您使用的AliOS-Things版本以及其组件是最新的,或者至少是与您的应用兼容的。有时,从GitHub或其他源代码仓库获取最新的补丁或修复可以解决此类问题。
查看官方文档和示例:AliOS-Things的官方文档和示例项目通常会提供如何正确配置和构建项目的指导。对比您的配置与官方示例,看是否有遗漏或错误的配置项。
社区与论坛:如果上述步骤不能解决问题,考虑在AliOS-Things的官方论坛或GitHub仓库提交问题,那里有活跃的开发者社区可能会提供帮助。
根据错误信息逐一排查,通常可以定位并解决这类链接错误。希望这些建议能帮助您解决问题。