RT-Thread / RT-Thread/rt-thread

添加SQLite数据库后编译出错

Open
#7,859 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

我的环境为RT-ThreadV5.0.0,ENV工具版本为V1.3.5

我在 menuconfig 里面的 RT-Thread Components 下使能了 DFS 和 FAL。

RT-Thread Components → C/C++ and POSIX layer 下使能了C++组件,没有使用C11的多线程函数。

RT-Thread Components → C/C++ and POSIX layer → POSIX (Portable Operating System Interface) layer 下使能了第一个和第二个选项分别是 “Enable POSIX file system and I/O”,“Enable devices as file descriptors”

按教程将SQLite数据库下载完后,编译出错。研究了1个星期完全不明白该从哪里下手,麻烦个位帮帮忙。

报错信息如下:

In file included from F:\Project\rtt-yangtao-lot\rt-thread-5.0.0\components\libc\compilers\common\include/sys/time.h:18,
                 from F:\Project\rtt-yangtao-lot\rt-thread-5.0.0\components\libc\compilers\common\include/sys/select.h:17,
                 from e:\rtt-env\env-windows-v1.3.5\tools\gnu_gcc\arm_gcc\mingw\arm-none-eabi\include\sys\types.h:50,
                 from e:\rtt-env\env-windows-v1.3.5\tools\gnu_gcc\arm_gcc\mingw\arm-none-eabi\include\stdio.h:61,
                 from packages\sqlite-v3.19.3\sqlite3.c:11616:
e:\rtt-env\env-windows-v1.3.5\tools\gnu_gcc\arm_gcc\mingw\arm-none-eabi\include\time.h:56:1: error: unknown type name 'clock_t'; did you mean '_flock_t'?
   56 | clock_t    clock (void);
        | ^~~~~~~
        | _flock_t
In file included from F:\Project\rtt-yangtao-lot\rt-thread-5.0.0\components\libc\compilers\common\include/sys/select.h:17,
                 from e:\rtt-env\env-windows-v1.3.5\tools\gnu_gcc\arm_gcc\mingw\arm-none-eabi\include\sys\types.h:50,
                 from e:\rtt-env\env-windows-v1.3.5\tools\gnu_gcc\arm_gcc\mingw\arm-none-eabi\include\stdio.h:61,
                 from packages\sqlite-v3.19.3\sqlite3.c:11616:
F:\Project\rtt-yangtao-lot\rt-thread-5.0.0\components\libc\compilers\common\include/sys/time.h:56:5: error: unknown type name 'suseconds_t'
   56 |     suseconds_t tv_usec;    /* and microseconds */
        |     ^~~~~~~~~~~

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/sqlite-v3.19.3/sqlite3.c around the reported include chain, then inspect components/libc/compilers/common/include/sys/time.h and sys/select.h alongside the toolchain headers. Reproduce the RT-Thread 5.0.0 build with the listed DFS, FAL, C++, and POSIX settings; done means SQLite compiles without the clock_t and suseconds_t errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, sqlite
Domain
build-system, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.