Closed SpotlightKid closed 2 months ago
incompatible pointer type error happening in embedded_files_loading.nim
as well:
Compiling example: /home/chris/work/nim/raylib-examples/others/embedded_files_loading.nim
/home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c: In function 'toWeakWave__OOZOOZOOZOOZOnimbleZpkgs50Znaylib4553O49O5445b55535555f565655fb485653b49485557f5557be52aa4949a5450535452d575650dZraylib_u2890':
/home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c:294173:20: error: assignment to 'tyOpenArray__UMVJID9bgFAzHOc9bt5jE4PA *' from incompatible pointer type 'NU8 *' {aka 'unsigned char *'} [-Wincompatible-pointer-types]
294173 | colontmpD_ = data_p0;
| ^
/home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c: In function 'toWeakImage__OOZOOZOOZOOZOnimbleZpkgs50Znaylib4553O49O5445b55535555f565655fb485653b49485557f5557be52aa4949a5450535452d575650dZraylib_u2837':
/home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c:294195:20: error: assignment to 'tyOpenArray__UMVJID9bgFAzHOc9bt5jE4PA *' from incompatible pointer type 'NU8 *' {aka 'unsigned char *'} [-Wincompatible-pointer-types]
294195 | colontmpD_ = data_p0;
| ^
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I/home/chris/.nimble/pkgs2/naylib-5.1.6-b7577f887fb085b1079f79be4aa11a62564d982d/raylib -I/home/chris/.nimble/pkgs2/naylib-5.1.6-b7577f887fb085b1079f79be4aa11a62564d982d/raylib/external/glfw/include -I/home/chris/.nimble/pkgs2/naylib-5.1.6-b7577f887fb085b1079f79be4aa11a62564d982d/raylib/external/glfw/deps/mingw -Wall -D_GNU_SOURCE -Wno-missing-braces -Werror=pointer-arith -DPLATFORM_DESKTOP_GLFW -DGRAPHICS_API_OPENGL_33 -fPIC -D_GLFW_X11 -O3 -fno-strict-aliasing -fno-ident -fno-math-errno -I/home/chris/.choosenim/toolchains/nim-2.0.8/lib -I/home/chris/work/nim/raylib-examples/others -o /home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c.o /home/chris/.cache/nim/embedded_files_loading_r/@membedded_files_loading.nim.c' failed with exit code: 1
stack trace: (most recent call last)
/home/chris/tmp/nimblecache-1369200236/nimscriptapi_3931930332.nim(212, 16)
/home/chris/work/nim/raylib-examples/raylib_examples.nimble(22, 9) testTask
/home/chris/.choosenim/toolchains/nim-2.0.8/lib/system/nimscript.nim(265, 7) exec
/home/chris/.choosenim/toolchains/nim-2.0.8/lib/system/nimscript.nim(265, 7) Error: unhandled exception: FAILED: nim c -d:release --verbosity:0 --hints:off /home/chris/work/nim/raylib-examples/others/embedded_files_loading.nim [OSError]
Tip: 4 messages have been suppressed, use --verbose to show them.
nimscriptwrapper.nim(161) execScript
Error: Exception raised during nimble script execution
And while I'm at it: compiling particles.nim
gives this warning:
/home/chris/work/nim/raylib-examples/personal/particles.nim(23, 1) Warning: A custom '=destroy' hook which takes a 'var T' parameter is deprecated; it should take a 'T' parameter [Deprecated]
Thanks for the report!
core/custom_logging.nim
still has the error. The parameter type of setTraceLogCallback
seems problematic.
core/custom_logging.nim
still has the error. The parameter type ofsetTraceLogCallback
seems problematic.
That was fixed in https://github.com/planetis-m/naylib/commit/613a64ddf39b908775989dc4d7cb313d9a8c5591 afaik it now compiles.
Sorry, I still get the same error:
LC_ALL=C nim c -d:release core/custom_logging.nim
/home/chris/.cache/nim/custom_logging_r/@m..@s..@s..@s..@s.nimble@spkgs2@snaylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e@sraylib.nim.c: In function 'setTraceLogCallback__OOZOOZOOZOOZOnimbleZpkgs50Znaylib4553O49O54455256ba5256ddc56484848cd48c50505148a5548e55565453554857cec52c5651eZraylib_u2817':
/home/chris/.cache/nim/custom_logging_r/@m..@s..@s..@s..@s.nimble@spkgs2@snaylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e@sraylib.nim.c:186:29: error: passing argument 1 of 'SetTraceLogCallback' from incompatible pointer type [-Wincompatible-pointer-types]
186 | SetTraceLogCallback(wrapperTraceLogCallback__OOZOOZOOZOOZOnimbleZpkgs50Znaylib4553O49O54455256ba5256ddc56484848cd48c50505148a5548e55565453554857cec52c5651eZraylib_u2793);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(int, char *, __va_list_tag *)
In file included from /home/chris/.cache/nim/custom_logging_r/@m..@s..@s..@s..@s.nimble@spkgs2@snaylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e@sraylib.nim.c:8:
/home/chris/.nimble/pkgs2/naylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e/raylib/raylib.h:1097:49: note: expected 'TraceLogCallback' {aka 'void (*)(int, const char *, __va_list_tag *)'} but argument is of type 'void (*)(int, char *, __va_list_tag *)'
1097 | RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set custom trace log
| ~~~~~~~~~~~~~~~~~^~~~~~~~
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -pthread -I/home/chris/.nimble/pkgs2/naylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e/raylib -I/home/chris/.nimble/pkgs2/naylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e/raylib/external/glfw/include -I/home/chris/.nimble/pkgs2/naylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e/raylib/external/glfw/deps/mingw -Wall -D_GNU_SOURCE -Wno-missing-braces -Werror=pointer-arith -DPLATFORM_DESKTOP_GLFW -DGRAPHICS_API_OPENGL_33 -fPIC -D_GLFW_X11 -O3 -fno-strict-aliasing -fno-ident -fno-math-errno -I/home/chris/.choosenim/toolchains/nim-2.0.8/lib -I/home/chris/work/nim/raylib-examples/core -o /home/chris/.cache/nim/custom_logging_r/@m..@s..@s..@s..@s.nimble@spkgs2@snaylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e@sraylib.nim.c.o /home/chris/.cache/nim/custom_logging_r/@m..@s..@s..@s..@s.nimble@spkgs2@snaylib-5.1.6-48ba48ddc8000cd0c2230a70e7865709cec4c83e@sraylib.nim.c' failed with exit code: 1
I made sure that I installed naylib from the Git HEAD and de-installed every other version and deleted the nim compiler cache.
I tried again (removed nimcache, etc) and it still works for me. We have the same gcc version, but you use an older nim version. I think the bug is in nim and it's fixed in devel.
Confirmed that it works with Nim devel:
$ nim -v
Nim Compiler Version 2.1.99 [Linux: amd64]
Compiled at 2024-09-06
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: d91297a330a4cccc4d82c06d4c33b16544b0c1bb
active boot switches: -d:release