环境:
RT-Thread Studio
版本: 2.0.0
构建ID: 202012101600
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 1.8.0_144
创建基于art_pi_factory项目,添加了MbedTLS软件包,编译的时候,提示‘DIR’类型未定义错误。
更换了MbedTLS的几个版本都是这样。
这是什么原因?
搜了一下论坛似乎没有人提到过这个问题。
log:
arm-none-eabi-gcc "../packages/mbedtls-latest/mbedtls/library/x509write_csr.c"
In file included from d:\rt-threadstudio\repo\extract\toolchain_support_packages\arm\gnu_tools_for_arm_embedded_processors\5.4.1\arm-none-eabi\include\dirent.h:7:0,
from ../packages/mbedtls-latest/mbedtls/library/x509_crt.c:74:
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:53:25: error: unknown type name 'DIR'
int closedir(DIR *);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:54:1: error: unknown type name 'DIR'
DIR *opendir(const char *);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:55:24: error: unknown type name 'DIR'
struct dirent *readdir(DIR *);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:56:26: error: unknown type name 'DIR'
int readdir_r(DIR *, struct dirent *, struct dirent **);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:57:26: error: unknown type name 'DIR'
void rewinddir(DIR *);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:58:24: error: unknown type name 'DIR'
void seekdir(DIR *, long int);
^
D:\RT-ThreadStudio\workspace\SmartWindow\rt-thread\components\libc\compilers\newlib/sys/dirent.h:59:24: error: unknown type name 'DIR'
long telldir(DIR *);
^
../packages/mbedtls-latest/mbedtls/library/x509_crt.c: In function 'mbedtls_x509_crt_parse_path':
../packages/mbedtls-latest/mbedtls/library/x509_crt.c:1182:5: error: unknown type name 'DIR'
DIR *dir = opendir( path );
^
../packages/mbedtls-latest/mbedtls/library/x509_crt.c:1195:22: warning: implicit declaration of function 'readdir' [-Wimplicit-function-declaration]
while( ( entry = readdir( dir ) ) != NULL )
^
../packages/mbedtls-latest/mbedtls/library/x509_crt.c:1195:20: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
while( ( entry = readdir( dir ) ) != NULL )
^
../packages/mbedtls-latest/mbedtls/library/x509_crt.c:1198:57: error: dereferencing pointer to incomplete type 'struct dirent'
"%s/%s", path, entry->d_name );
^
../packages/mbedtls-latest/mbedtls/library/x509_crt.c:1224:5: warning: implicit declaration of function 'closedir' [-Wimplicit-function-declaration]
closedir( dir );
^
make: *** [packages/mbedtls-latest/mbedtls/library/subdir.mk:228: packages/mbedtls-latest/mbedtls/library/x509_crt.o] Error 1
make: *** Waiting for unfinished jobs....
"make -j4 all" terminated with exit code 2. Build might be incomplete.
12:21:56 Build Failed. 11 errors, 4 warnings. (took 12m:51s.306ms)
我重新建一个arp_pi_wifi的模板工程,然后首先添加MbedTLS,又没问题了。
不知道是工程模板的问题,还是软件包顺序问题。
#include "dfs_posix.h"