[STM32F4] 如何为STM32编译libbson?

[复制链接]
 楼主| 唐纳德d 发表于 2025-8-4 22:45 | 显示全部楼层 |阅读模式
如何为STM32编译libbson?
我正在交叉编译libbson,以便将其作为库包含到STM32CubeIDE中,用于STM32 ARM核心处理器。已经指定了工具链。我尝试使用ARM的工具链进行编译(在Ubuntu和Windows上都试过)。在用MinGW Makefiles生成Makefile后,编译失败(在Ubuntu和Windows平台上同样出现此错误):
[  1%] Building C object src/libbson/CMakeFiles/bson_shared.dir/src/bson/bcon.c.obj
In file included from C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bson-compat.h:75,
                 from C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bson.h:23,
                 from C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.h:26,
                 from C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:24:
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c: In function '_bcon_append_tokenize':
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:470:27: warning: 'bcon_type_t' is promoted to 'int' when passed through '...'
  470 |       type = va_arg (*ap, bcon_type_t);
      |                           ^
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:470:27: note: (so you should pass 'int' not 'bcon_type_t' to 'va_arg')
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:470:27: note: if this code is reached, the program will abort
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:486:40: warning: 'bson_subtype_t' is promoted to 'int' when passed through '...'
  486 |          u->BIN.subtype = va_arg (*ap, bson_subtype_t);
      |                                        ^
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:486:40: note: if this code is reached, the program will abort
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c: In function '_bcon_extract_tokenize':
C:\Users\blast\CodeSandbox\bson2\mongo-c-driver\src\libbson\src\bson\bcon.c:602:27: warning: 'bcon_type_t' is promoted to 'int' when passed through '...'
  602 |       type = va_arg (*ap, bcon_type_t);
      |                           ^
您需要登录后才可以回帖 登录 | 注册

本版积分规则

41

主题

41

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部