error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]

简介: error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]

具体错误:

builds/unix/ftsystem.c:325:22: error: implicit declaration of function 'read'
      [-Werror,-Wimplicit-function-declaration]
        read_count = read( file,
                     ^
builds/unix/ftsystem.c:325:22: note: did you mean 'fread'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:158:9: note: 
      'fread' declared here
size_t   fread(void * __restrict __ptr, size_t __size, size_t __nitems, ...
         ^
builds/unix/ftsystem.c:346:5: error: implicit declaration of function 'close'
      [-Werror,-Wimplicit-function-declaration]
    close( file );

解决办法:

说到底就是没有包含相应的头文件:

#include <fcntl.h>
#include <unistd.h>
目录
相关文章
|
15天前
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
|
2月前
|
JavaScript
【报错】:Cannot read properties of undefined (reading ‘prototype‘)
【报错】:Cannot read properties of undefined (reading ‘prototype‘)
110 0
|
5月前
|
JavaScript 前端开发
element-plus 报错 TypeError: Cannot read properties of undefined (reading ‘setCheckedKeys‘)
element-plus 报错 TypeError: Cannot read properties of undefined (reading ‘setCheckedKeys‘)
115 0
|
9月前
|
Linux
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
77 0
|
Dart 前端开发 JavaScript
Syntax Error: TypeError: this.getOptions is not a function
Syntax Error: TypeError: this.getOptions is not a function
453 0
Syntax Error: TypeError: this.getOptions is not a function
error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]
176 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
95 0
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
111 0
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
error: possibly undefined macro: LT_SYS_SYMBOL_USCORE please use m4_pattern_allow
110 0