常见编译错误
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[C]]
* error: control reaches end of non-void function [-Werro...
缺少return
#codeprettify{{
return 0;
}}
* error: unknown type name 'bool' [#k8000770]
在C语言标准(C89)没有定义布尔类型,所以会报错。而C99提供了...
#codeprettify{{
#include <stdbool.h>
}}
&color(red){注意:C语言 #include 的顺序会引发,有一些基础...
* error: 'sprintf' may write a terminating nul past the e...
chr数组长度不够
* 编译的时候没问题,但是ld build时报错 undefined referenc...
下面报错信息里面的 sntp_service_start 是app_datetime.c里...
问题的原因:include 的head 文件的顺序导致的
#codeprettify{{
$ make all
Toolchain path: /opt/xtensa-lx106-elf/bin/xtensa-lx106-el...
Toolchain version: esp-2020r3-49-gd5524c1
Compiler version: 8.4.0
Python requirements from D:_RTOS_SDK/requirements.txt are...
Project is not inside a git repository, or git repository...
will not use 'git describe' to determine PROJECT_VER.
App "ESP8266" version: 1
CC build/main/app_datetime.o
CC build/main/app_main.o
CC build/main/app_wifi.o
AR build/main/libmain.a
Generating esp8266.project.ld
LD build/ESP8266.elf
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
D:/main/app_main.c:357: undefined reference to `sntp_serv...
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
D:/main/app_wifi.c:487: undefined reference to `sntp_serv...
collect2.exe: error: ld returned 1 exit status
make: *** [D:_RTOS_SDK/make/project.mk:510:/home/Adminis...
}}
#hr();
コメント:
#comment_kcaptcha
終了行:
[[C]]
* error: control reaches end of non-void function [-Werro...
缺少return
#codeprettify{{
return 0;
}}
* error: unknown type name 'bool' [#k8000770]
在C语言标准(C89)没有定义布尔类型,所以会报错。而C99提供了...
#codeprettify{{
#include <stdbool.h>
}}
&color(red){注意:C语言 #include 的顺序会引发,有一些基础...
* error: 'sprintf' may write a terminating nul past the e...
chr数组长度不够
* 编译的时候没问题,但是ld build时报错 undefined referenc...
下面报错信息里面的 sntp_service_start 是app_datetime.c里...
问题的原因:include 的head 文件的顺序导致的
#codeprettify{{
$ make all
Toolchain path: /opt/xtensa-lx106-elf/bin/xtensa-lx106-el...
Toolchain version: esp-2020r3-49-gd5524c1
Compiler version: 8.4.0
Python requirements from D:_RTOS_SDK/requirements.txt are...
Project is not inside a git repository, or git repository...
will not use 'git describe' to determine PROJECT_VER.
App "ESP8266" version: 1
CC build/main/app_datetime.o
CC build/main/app_main.o
CC build/main/app_wifi.o
AR build/main/libmain.a
Generating esp8266.project.ld
LD build/ESP8266.elf
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
D:/main/app_main.c:357: undefined reference to `sntp_serv...
d:/xtensa-lx106-elf/bin/ld.exe: D:/build/main\libmain.a(a...
D:/main/app_wifi.c:487: undefined reference to `sntp_serv...
collect2.exe: error: ld returned 1 exit status
make: *** [D:_RTOS_SDK/make/project.mk:510:/home/Adminis...
}}
#hr();
コメント:
#comment_kcaptcha
ページ名: