开发者社区 问答 正文

Alios things在ubuntu中编译运行出错,如何解决?

luokuipeng@luokuipeng-virtual-machine:~/AliOS-Things$ aos make helloworld@linuxhost -c config && aos make aos-cube version: 0.3.11 Creating .defconfig ... Creating .config ...

configuration written to .config

Checking config output: .config ... aos-cube version: 0.3.11

Build Configuration:

App: helloworld Board: linuxhost

Creating out/config/autoconf.h ... Applying changes made to: out/config/autoconf.h app_version:app-1.0.0-20200218.023828 processing components: helloworld linuxhost *** All Components: helloworld linuxhost osal_aos mcu_linuximpl kernel_init rhino debug arch_linux netmgr ulog kv yloop vfs lib_rbtree *** Config Enabled: lib_rbtree Build AOS Now TOOLCHAIN_PATH= Compiling helloworld Compiling osal_aos Compiling mcu_linuximpl Compiling kernel_init Compiling rhino Compiling debug Compiling arch_linux Compiling netmgr platform/arch/linux/cpu_impl.c:101:14: error: static declaration of ‘gettid’ follows non-static declaration 101 | static pid_t gettid(void) | ^~~~~~ In file included from /usr/include/unistd.h:1170, from platform/arch/linux/cpu_impl.c:13: /usr/include/i386-linux-gnu/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here 34 | extern __pid_t gettid (void) __THROW; | ^~~~~~ build/build_rules/aos_target_build.mk:232: recipe for target 'out/helloworld@linuxhost/modules/platform/arch/linux/cpu_impl.o' failed make[1]: *** [out/helloworld@linuxhost/modules/platform/arch/linux/cpu_impl.o] Error 1 make[1]: *** 正在等待未完成的任务.... network/netmgr/src/netmgr.c: In function ‘netmgr_connect’: network/netmgr/src/netmgr.c:56:37: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign] 56 | password == NULL || strlen(password) > MAX_PWD_SIZE) { | ^~~~~~~~ | | | const uint8_t * {aka const unsigned char *} In file included from network/netmgr/src/netmgr.c:6: /usr/include/string.h:384:35: note: expected ‘const char *’ but argument is of type ‘const uint8_t *’ {aka ‘const unsigned char *’} 384 | extern size_t strlen (const char *__s) | ~~~~^ network/netmgr/src/netmgr.c:61:42: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign] 61 | strncpy(config.pwd, password, strlen(password)); | ^~ | | | const uint8_t * {aka const unsigned char *} In file included from network/netmgr/src/netmgr.c:6: /usr/include/string.h:384:35: note: expected ‘const char *’ but argument is of type ‘const uint8_t *’ {aka ‘const unsigned char *’} 384 | extern size_t strlen (const char *__s) | ^ network/netmgr/src/netmgr.c:61:25: warning: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness [-Wpointer-sign] 61 | strncpy(config.pwd, password, strlen(password)); | ^~ | | | const uint8_t * {aka const unsigned char *} In file included from /usr/include/features.h:446, from /usr/include/i386-linux-gnu/bits/libc-header-start.h:33, from /usr/include/stdlib.h:25, from network/netmgr/src/netmgr.c:5: /usr/include/i386-linux-gnu/bits/string_fortified.h:103:1: note: expected ‘const char * restrict’ but argument is of type ‘const uint8_t *’ {aka ‘const unsigned char *’} 103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src, | ^ build/Makefile:390: recipe for target 'main_app' failed make: *** [main_app] Error 2 [AliOS-Things] ERROR: "/home/luokuipeng/AliOS-Things/build/cmd/linux64/make" returned error code 2. [AliOS-Things] ERROR: Command "/home/luokuipeng/AliOS-Things/build/cmd/linux64/make HOST_OS=Linux64 TOOLS_ROOT=/home/luokuipeng/AliOS-Things/build -e -f build/Makefile" in "/home/luokuipeng/AliOS-Things"

展开
收起
luokuipeng 2020-02-18 03:08:17 2706 分享 版权
阿里云 AI 助理回答

在您尝试使用aos make helloworld@linuxhost -c config命令时,看起来您正尝试为helloworld示例在linuxhost平台上配置编译选项。根据提供的知识库资料,这里是如何操作的详细指南:

  1. 问题描述: 您希望在AliOS Things环境中为helloworld示例项目配置linuxhost平台的编译设置。

  2. 解决方案步骤

    • 确认工作环境:确保当前目录位于已通过aos init初始化的工作区中,并且您的环境已经正确设置了AliOS Things开发工具链。

    • 执行配置命令:您已经尝试使用的命令aos make helloworld@linuxhost -c config是正确的途径来为特定solution(这里是helloworld)和目标board(这里是linuxhost)生成配置文件。此命令会在当前目录下生成或更新.config文件,其中包含了编译该solution所需的配置信息。

    • 检查配置结果:执行上述命令后,如果没有错误信息,说明配置成功。您可以查看生成的.config文件来确认配置细节,如果需要手动调整某些配置项,可直接编辑这个文件。

  3. 注意事项

    • 平台支持:确保helloworld示例支持linuxhost平台。虽然大多数示例适用于多种硬件平台,但特定示例可能有平台限制。
    • 依赖检查:在编译前,请确认所有依赖组件已通过aos install命令正确安装,特别是对于特定平台的依赖。
    • 权限问题:在Linux环境下操作时,确保您有足够的权限执行这些命令,避免因权限不足导致的失败。
  4. 验证与测试

    • 在完成配置后,可以通过运行aos make来编译项目。如果一切配置无误,编译应能顺利进行。
    • 编译完成后,根据项目情况,可能有相应的运行或测试命令来验证程序是否正常工作。
  5. 进一步支持: 如果在配置或编译过程中遇到任何错误或警告,首先查阅.config文件以确认配置是否符合预期,其次检查终端输出的错误信息,这通常会提供解决问题的线索。如需更进一步的帮助,可以收集详细的错误日志并寻求社区或技术支持。

请按照上述步骤操作,如果在任一环节遇到困难,及时检查相关文档或提交具体问题以便获得针对性的协助。

有帮助
无帮助
AI 助理回答生成答案可能存在不准确,仅供参考
0 条回答
写回答
取消 提交回答