You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
使用最新的master分支(b6f30d8)的源码,在ubuntu22.04上,系统默认的gcc版本是gcc10,构建C++报错,找不到,应该是gcc10不支持c++20
通过源码构建安装了gcc14,构建报错implicit declaration of function ‘fdopen’
通过在make.lua中添加linux = { flags = "-std=gnu17" }解决了,但是觉得有点怪异,感觉指定了两个标准库,还有别的办法解决吗
具体报错
[210/430] Compile C build/linux/debug/obj/ecs/ecs_persistence.obj
FAILED: build/linux/debug/obj/ecs/ecs_persistence.obj
gcc -MMD -MT build/linux/debug/obj/ecs/ecs_persistence.obj -MF build/linux/debug/obj/ecs/ecs_persistence.obj.d -std=c17 -Wall -g -Ibuild/linux/debug/lua54 -o build/linux/debug/obj/ecs/ecs_persistence.obj -c 3rd/luaecs/ecs_persistence.c
3rd/luaecs/ecs_persistence.c: In function ‘fileopen’:
3rd/luaecs/ecs_persistence.c:301:19: error: implicit declaration of function ‘fdopen’; did you mean ‘fopen’? [-Wimplicit-function-declaration]
301 | FILE *f = fdopen(fd, mode);
| ^~~~~~
| fopen
3rd/luaecs/ecs_persistence.c:301:19: error: initialization of ‘FILE *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
系统:
Linux version 6.5.0-35-generic (buildd@lcy02-amd64-079) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) # 35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2
GCC版本:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/14.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure -enable-checking=release -enable-language=c,c++ -disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.1.0 (GCC)
The text was updated successfully, but these errors were encountered:
使用最新的master分支(b6f30d8)的源码,在ubuntu22.04上,系统默认的gcc版本是gcc10,构建C++报错,找不到,应该是gcc10不支持c++20
通过源码构建安装了gcc14,构建报错
implicit declaration of function ‘fdopen’
通过在make.lua中添加
linux = { flags = "-std=gnu17" }
解决了,但是觉得有点怪异,感觉指定了两个标准库,还有别的办法解决吗具体报错
[210/430] Compile C build/linux/debug/obj/ecs/ecs_persistence.obj
FAILED: build/linux/debug/obj/ecs/ecs_persistence.obj
gcc -MMD -MT build/linux/debug/obj/ecs/ecs_persistence.obj -MF build/linux/debug/obj/ecs/ecs_persistence.obj.d -std=c17 -Wall -g -Ibuild/linux/debug/lua54 -o build/linux/debug/obj/ecs/ecs_persistence.obj -c 3rd/luaecs/ecs_persistence.c
3rd/luaecs/ecs_persistence.c: In function ‘fileopen’:
3rd/luaecs/ecs_persistence.c:301:19: error: implicit declaration of function ‘fdopen’; did you mean ‘fopen’? [-Wimplicit-function-declaration]
301 | FILE *f = fdopen(fd, mode);
| ^~~~~~
| fopen
3rd/luaecs/ecs_persistence.c:301:19: error: initialization of ‘FILE *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
系统:
Linux version 6.5.0-35-generic (buildd@lcy02-amd64-079) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) # 35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2
GCC版本:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/14.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure -enable-checking=release -enable-language=c,c++ -disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.1.0 (GCC)
The text was updated successfully, but these errors were encountered: