Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
459 stars 101 forks source link

Error: Use of undeclared identifier 'L_tmpnam' #76

Closed Miou-zora closed 2 months ago

Miou-zora commented 3 months ago

Hello, I've just cloned the repo and executed zig build examples, encountering the following error:

raylib.zig build-lib raylib Debug native-native: error: error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtext.c:68:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rglfw.c:61:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/src/init.c:30:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/src/internal.h:331:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/src/platform.h:62:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/src/x11_platform.h:36:
In file included from /usr/include/X11/Xcursor/Xcursor.h:26:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rglfw.c:87:
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/src/posix_poll.c:29:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
<command line>:4:9: note: previous definition is here

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rmodels.c:56:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rmodels.c:111:
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/par_shapes.h:1133:32: warning: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-const-int-float-conversion]
/usr/include/stdlib.h:87:18: note: expanded from macro 'RAND_MAX'

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rcore.c:95:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/utils.c:48:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtextures.c:79:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'

error(compilation): clang failed with stderr: In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/raudio.c:176:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/miniaudio.h:3857:
In file included from /usr/include/pthread.h:21:
/usr/include/features.h:478:9: warning: '__GLIBC_MINOR__' macro redefined [-Wmacro-redefined]
<command line>:1:9: note: previous definition is here
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/raudio.c:176:
In file included from /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/miniaudio.h:11447:
/usr/include/stdio.h:205:27: error: use of undeclared identifier 'L_tmpnam'
/usr/include/stdio.h:210:33: error: use of undeclared identifier 'L_tmpnam'

raylib.zig build-lib raylib Debug native-native: error: the following command failed with 7 compilation errors:
/nix/store/mnwwkbzsbxpndxxilby0ji6qc5nf037m-zig-0.11.0/bin/zig build-lib -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rcore.c /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/utils.c -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/raudio.c -cflags -fno-sanitize=undefined -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rmodels.c -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rshapes.c -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtext.c -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtextures.c -cflags -std=gnu99 -D_GNU_SOURCE -DGL_SILENCE_DEPRECATION=199309L -- /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rglfw.c -lGL -lX11 -lc --cache-dir /home/miouzora/perso/Curve/raylib-zig/zig-cache --global-cache-dir /home/miouzora/.cache/zig --name raylib -static -target native-native -mcpu x86_64+adx+aes+avx+avx2+bmi+bmi2+clflushopt+clwb+cx16+f16c+fma+fsgsbase+gfni+invpcid+lzcnt+movbe+movdir64b+movdiri+pclmul+popcnt+prfchw+rdpid+rdrnd+rdseed+sahf+sha+shstk+sse3+sse4_1+sse4_2+ssse3+vaes+vpclmulqdq+waitpkg+xsave+xsavec+xsaveopt+xsaves -I /home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/external/glfw/include -I /usr/include -D PLATFORM_DESKTOP -L /usr/lib --listen=- 
Build Summary: 1/4 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install raylib transitive failure
   └─ zig build-lib raylib Debug native-native 7 errors
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtext.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rglfw.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rmodels.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rcore.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/utils.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/rtextures.c:1:1: error: unable to build C object: clang exited with code 1
/home/miouzora/.cache/zig/p/1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b/src/raudio.c:1:1: error: unable to build C object: clang exited with code 1

Zig version is: 0.11.0 Commit: 068f9e18168b986de0858b25e7adec3e212a3726

Not-Nik commented 2 months ago

I can't repro this on my Mac. What system are you running?

Miou-zora commented 2 months ago

I'm using WSL 2