Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the build #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix the build #28

wants to merge 1 commit into from

Conversation

evaporei
Copy link

I tried running make on my M1 Mac and got this error:

ar rcu libraylua.a src/raylua.o
cc -o raylua_s src/raylua_s.o libraylua.a -O2 -s -lm luajit/src/libluajit.a raylib/src/libraylib.a -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL  luajit/src/libluajit.a
ld: warning: -s is obsolete
ld: warning: ignoring duplicate libraries: 'luajit/src/libluajit.a'
cc -c -o src/raylua_e.o src/raylua_e.c -O2 -s -Iluajit/src -Iraylib/src -Iraygui/src -Iphysac/src -DGRAPHICS_API_OPENGL_33 -DPLATFORM_DESKTOP -target arm64-apple-macos11
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
src/raylua_e.c:198:27: error: incompatible function pointer types passing 'unsigned char *(const char *, unsigned int *)' to parameter of type 'LoadFileDataCallback' (aka 'unsigned char *(*)(const char *, int *)') [-Wincompatible-function-pointer-types]
  SetLoadFileDataCallback(raylua_loadFileData);
                          ^~~~~~~~~~~~~~~~~~~
raylib/src/raylib.h:1092:57: note: passing argument to parameter 'callback' here
RLAPI void SetLoadFileDataCallback(LoadFileDataCallback callback); // Set custom file binary data loader
                                                        ^
1 error generated.
make: *** [src/raylua_e.o] Error 1

So I fixed the types (by casting) in src/raylua_e.c and was able to compile and use raylua_e 🎉 . Looking further into the project, this seems the incorrect approach for the fix, the bindings might be wrong in tools/autocomplete/api/raylib_api.lua (line 3033, LoadFileDataCallback definition). Though I tried changing the types there and (even after make clean) the build still gives the same error.

This fixes the build for whoever needs it, but it's not the correct way to do it. If you can help me to fix it in the right place, I can change the Pull Request right away 🙂

@TSnake41
Copy link
Owner

TSnake41 commented Dec 7, 2024

I think the problem is due to raysan5/raylib@97ef819, we should instead change the parameter type of raylua_loadFileData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants