Open adrianbrink opened 3 weeks ago
Could you run the compile command in your shell to provide more helpful errors?
I compiled it from the shell, here is what I got on Fedora
╰─>$ gcc -O3 -I~/Repositories/raylib/src/ -fPIC -shared -o "/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.so" "/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.x86_64-pc-linux-gnu.c"
/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.x86_64-pc-linux-gnu.c:12:10: fatal error: rcamera.h: No such file or directory
12 | #include "rcamera.h"
| ^~~~~~~~~~~
compilation terminated.
I manually compiled it by cloning the raylib repo and adding this to the previous gcc
command;
-I/home/joe/Repositories/raylib/src/
Not sure if it's the same error adrianbrink is getting, but I'm pretty sure I must have incompatible versions, which is surprising, I'm using the one from the dnf repo. I can try compiling and installing latest raylib.
I got this error when loading;
Error opening shared object "/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.so":
/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.so: undefined symbol: GetMouseRay.
[Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]
This must be a version mismatch because I'm missing GetMouseRay
I compiled it from the shell, here is what I got on Fedora
╰─>$ gcc -O3 -I~/Repositories/raylib/src/ -fPIC -shared -o "/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.so" "/home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.x86_64-pc-linux-gnu.c" /home/joe/.local/share/quicklisp/local-projects/claw-raylib/lib/libraylib-adapter.x86_64-pc-linux-gnu.c:12:10: fatal error: rcamera.h: No such file or directory 12 | #include "rcamera.h" | ^~~~~~~~~~~ compilation terminated.
I manually compiled it by cloning the raylib repo and adding this to the previous
gcc
command;
-I/home/joe/Repositories/raylib/src/
Not sure if it's the same error adrianbrink is getting, but I'm pretty sure I must have incompatible versions, which is surprising, I'm using the one from the dnf repo. I can try compiling and installing latest raylib.
Please use the released 5.0 version of Raylib, which should work fine with the prebuilt branch.
Please use the released 5.0 version of Raylib, which should work fine with the prebuilt branch.
Thanks for the response. I checked out tag 5.0, built and installed, and I'm still getting the rcamera error as well as the GetMouseRay error.
This is the command I'm running from SBCL + Sly
(let ((arch "x86_64-pc-linux-gnu")
(path (merge-pathnames #P"lib/" (asdf:component-pathname (asdf:find-system '#:claw-raylib)))))
(dolist (lib '("raylib" "rlgl"))
(uiop:run-program
(list "gcc" "-O3" "-I/home/joe/Repositories/raylib/src/" "-fPIC" "-shared" "-o"
(namestring (merge-pathnames (format nil "lib~A-adapter.so" lib) path))
(namestring (merge-pathnames (format nil "lib~A-adapter.~A.c" lib arch) path))))))
I add the include directory since raylib isn't installing rcamera.h, and I also removed raygui since I haven't installed it either.
This is the command I'm running from SBCL + Sly
(let ((arch "x86_64-pc-linux-gnu") (path (merge-pathnames #P"lib/" (asdf:component-pathname (asdf:find-system '#:claw-raylib))))) (dolist (lib '("raylib" "rlgl")) (uiop:run-program (list "gcc" "-O3" "-I/home/joe/Repositories/raylib/src/" "-fPIC" "-shared" "-o" (namestring (merge-pathnames (format nil "lib~A-adapter.so" lib) path)) (namestring (merge-pathnames (format nil "lib~A-adapter.~A.c" lib arch) path))))))
I add the include directory since raylib isn't installing rcamera.h, and I also removed raygui since I haven't installed it either.
Let's clarify this issue: the error occurs because the libraylib-adapter.so
expects the GetMouseRay
symbol, but the libraylib.so
loaded by the Lisp session doesn't contain it. This causes an error when loading libraylib-adapter.so
. You need to check if libraylib.so
is version 5.0 or use nm -g libraylib.so
to confirm the presence of this symbol.
I can confirm that the GetMouseRay
function does get replaced by a macro in the latest unreleased version of Raylib. So if this symbol is missing, you're likely still using a libraylib.so
compiled from the Git version.
Thank you for the help.
I finally got around to trying again, first I fixed the rcamera issue by moving the header file there;
sudo cp rcamera.h /usr/local/include/
Then to fix the GetMouseRay
, I searched through the github commits and found that this commit is the one that adds the macro. The commit tagged as 5.0 does not work.
Now, when I run the Lisp code in step 3 to build the adapters, everything seems to compile;
┬─[joe@flowjoe-f37:~/quick/local/claw-raylib]─[12:24:47 PM]
╰─>$ la lib/*.so
-rwxr-xr-x. 1 joe joe 107K Nov 9 12:25 lib/libraygui-adapter.so*
-rwxr-xr-x. 1 joe joe 172K Nov 9 12:25 lib/libraylib-adapter.so*
-rwxr-xr-x. 1 joe joe 17K Nov 9 12:25 lib/librlgl-adapter.so*
However, when I try to load claw-raylib
with the command (ql:quickload :claw-raylib)
in step 4, I get the following error;
There is no package named #:RAYGUI.
[Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]
Not sure what I did wrong. Here are the contents of /usr/local/include
┬─[joe@flowjoe-f37:~/quick/local/claw-raylib]─[12:27:06 PM]
╰─>$ la /usr/local/include/r*.h
-rw-r--r--. 1 root root 274K Nov 9 12:13 /usr/local/include/raygui.h
-rw-r--r--. 1 root root 124K Nov 9 12:04 /usr/local/include/raylib.h
-rw-r--r--. 1 root root 69K Nov 9 12:04 /usr/local/include/raymath.h
-rw-r--r--. 1 root root 22K Nov 9 12:17 /usr/local/include/rcamera.h
-rw-r--r--. 1 root root 227K Nov 9 12:04 /usr/local/include/rlgl.h
Let me know if there is any other information I can provide that would help with further debugging. Thank you for your time.
Edit: I did not compile raygui into a shared object. I that step is needed, let me know.
Also, is it possible to make raygui optional? I don't really wish to use it.
Also, is it possible to make raygui optional? I don't really wish to use it.
Dependency on Raygui was made optional 6 months ago. Are you using the older version of claw-raylib
?
I am currently on the prebuild branch
31b0d54 * prebuild origin/prebuild Prebuild for Raylib 5.0 and Raygui 4.0
b70c03a * origin/master Fix compilation for Windows
1c4a3c5 * Fix compilation on ECL
Any idea why I'm getting this error? https://github.com/bohonghuang/claw-raylib/issues/7#issuecomment-2466060133
I am currently on the prebuild branch
31b0d54 * prebuild origin/prebuild Prebuild for Raylib 5.0 and Raygui 4.0 b70c03a * origin/master Fix compilation for Windows 1c4a3c5 * Fix compilation on ECL
Any idea why I'm getting this error? https://github.com/bohonghuang/claw-raylib/issues/7#issuecomment-2466060133
For further debugging, please provide the filename being compiled at the REPL prompt, usually shown as Compiling "*.lisp"
.
I'm not sure what you mean, but I'll paste some output
CL-USER> (ql:quickload :claw-raylib)
To load "claw-raylib":
Load 1 ASDF system:
claw-raylib
; Loading "claw-raylib"
; Debugger entered on #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "There is no package named ~S." {1003497C93}>
And here is the backtrace
There is no package named #:RAYGUI.
[Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]
Restarts:
0: [CONTINUE] Ignore.
1: [TRY-RECOMPILING] Recompile library and try loading it again
2: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "claw-raylib.library" "library">.
3: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "claw-raylib.library" "library"> as having been successful.
4: [RETRY] Retry ASDF operation.
5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
--more--
Backtrace:
0: (DELETE-PACKAGE #:RAYGUI)
1: ((SB-C::TOP-LEVEL-FORM (FLET ((#1=#:FORM-FUN-3 NIL . #2=((PROGN . #3=(#4=#)))) (#5=#:FUN1 NIL (DECLARE . #3#) . #2#)) (DECLARE (DYNAMIC-EXTENT (FUNCTION #1#) (FUNCTION . #6=(#5#)))) (DECLARE (INLINE #..
2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10..
3: ((LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL))
4: (SB-IMPL::CALL-WITH-LOADER-PACKAGE-NAMES #<FUNCTION (LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL) {100349233B}>)
5: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10034862D3}> NIL NIL)
6: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10034862D3}> T)
7: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {7F72FE8E472B}> #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp..
8: (LOAD #P"/home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
9: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<FUNCTION (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1003485E2B}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))
10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">)
11: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (ASDF/LISP-ACTION:LOAD-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">)..
13: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">) [fast-method]
14: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10030546A3}>) [fast-method]
15: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
16: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10030546A3}>) [fast-method]
17: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "claw-raylib"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
18: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "claw-raylib"> :VERBOSE NIL)
19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
I'm not sure what you mean, but I'll paste some output
CL-USER> (ql:quickload :claw-raylib) To load "claw-raylib": Load 1 ASDF system: claw-raylib ; Loading "claw-raylib" ; Debugger entered on #<SB-KERNEL:SIMPLE-PACKAGE-ERROR "There is no package named ~S." {1003497C93}>
And here is the backtrace
There is no package named #:RAYGUI. [Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR] Restarts: 0: [CONTINUE] Ignore. 1: [TRY-RECOMPILING] Recompile library and try loading it again 2: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "claw-raylib.library" "library">. 3: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "claw-raylib.library" "library"> as having been successful. 4: [RETRY] Retry ASDF operation. 5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration. --more-- Backtrace: 0: (DELETE-PACKAGE #:RAYGUI) 1: ((SB-C::TOP-LEVEL-FORM (FLET ((#1=#:FORM-FUN-3 NIL . #2=((PROGN . #3=(#4=#)))) (#5=#:FUN1 NIL (DECLARE . #3#) . #2#)) (DECLARE (DYNAMIC-EXTENT (FUNCTION #1#) (FUNCTION . #6=(#5#)))) (DECLARE (INLINE #.. 2: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10.. 3: ((LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL)) 4: (SB-IMPL::CALL-WITH-LOADER-PACKAGE-NAMES #<FUNCTION (LAMBDA NIL :IN SB-FASL::LOAD-AS-FASL) {100349233B}>) 5: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10034862D3}> NIL NIL) 6: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" {10034862D3}> T) 7: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {7F72FE8E472B}> #<SB-SYS:FD-STREAM for "file /home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp.. 8: (LOAD #P"/home/joe/.cache/common-lisp/sbcl-2.3.11-linux-x64/home/joe/quicklisp/local-projects/claw-raylib/library.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT) 9: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<FUNCTION (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1003485E2B}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS))) 10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">) 11: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION)) 12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (ASDF/LISP-ACTION:LOAD-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">).. 13: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "claw-raylib.library" "library">) [fast-method] 14: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10030546A3}>) [fast-method] 15: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT)) 16: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10030546A3}>) [fast-method] 17: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "claw-raylib"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method] 18: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "claw-raylib"> :VERBOSE NIL) 19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
Let me think, this issue is somewhat strange because the raygui
package is expected to exist before the load of library.lisp
@JosephFerano You can invoke the CONTINUE
restart as a workaround at present.
It seems to load now, however, it loads and the REPL hangs afterwards. I can't evaluate anything afterwards. Not even (+ 1 1). I have to kill -9 in order to kill the SBCL instance repl. Seems stuck in a loop. So I can't evaluate the basic window example or anything.
It seems to load now, however, it loads and the REPL hangs afterwards. I can't evaluate anything afterwards. Not even (+ 1 1). I have to kill -9 in order to kill the SBCL instance repl. Seems stuck in a loop. So I can't evaluate the basic window example or anything.
Did you run SBCL with the --dynamic-space-size 4096
argument?
Theoretically, now that the error occurs only when executing delete-package
, which means all the shared libraries can be loaded successfully, I believe there aren’t many remaining issues aside from this strange one. I currently cannot figure out why this situation could happen, but I suggest you clear the cache in ~/.cache/common-lisp/sbcl-...
or try a different implementation such as Clozure CL.
Ok, so I added this to my emacs config;
(setq sly-lisp-implementations '((sbcl ("/usr/local/bin/sbcl" "--dynamic-space-size" "4096"))))
The window loads! Great! Raylib hangs the REPL though, is there a way for me to let raylib continue running and still have access to the REPL so I can start making live changes to my game?
I'm still getting the There is no package named #:RAYGUI.
error though.
Thanks again for your help! I'm almost there.
Ok, so I added this to my emacs config;
(setq sly-lisp-implementations '((sbcl ("/usr/local/bin/sbcl" "--dynamic-space-size" "4096"))))
The window loads! Great! Raylib hangs the REPL though, is there a way for me to let raylib continue running and still have access to the REPL so I can start making live changes to my game?
I'm still getting the
There is no package named #:RAYGUI.
error though.Thanks again for your help! I'm almost there.
Run with C-x C-e
instead of in REPL. This will spawn a new thread to run the game loop.
I'm still getting the There is no package named #:RAYGUI. error though.
I've never come across this issue. However, it's strongly recommended to clean the compilation cache and reload the system, or try another implementations to confirm whether the same error can be reproduced.
Darwin xxx.local 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020 arm64
andmacOS Sequioa 15.1
sbcl --dynamic-space-size 8192
prebuilt
branchraylib
withbrew install raylib
brew install llvm@18
and set the correct variables withI run
I get
Any idea how to debug this further?