tjammer / raylib-ocaml

OCaml bindings for raylib and raygui
https://tjammer.github.io/raylib-ocaml/
MIT License
173 stars 14 forks source link

Installation with opam failed #28

Closed yuesubi closed 1 year ago

yuesubi commented 1 year ago

Hi, I am having trouble installing the library. I ran opam depext raylib with opam v2.1.3. I made sure to install the dependencies with sudo pacman -S alsa-lib mesa libx11 libxrandr libxi libxcursor libxinerama and opam depext raylib. I am on manjaro 21.3.

Here is the output, that I got :

The following actions will be performed:
  ∗ install raylib 0.5.1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved raylib.0.5.1  (cached)
[ERROR] The compilation of raylib.0.5.1 failed at "dune build -p raylib -j 11 @install".

#=== ERROR while compiling raylib.0.5.1 =======================================#
# context     2.1.3 | linux/x86_64 | ocaml.4.14.0 | https://opam.ocaml.org#3a8f24e3
# path        ~/.opam/default/.opam-switch/build/raylib.0.5.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p raylib -j 11 @install
# exit-code   1
# env-file    ~/.opam/log/raylib-28379-691629.env
# output-file ~/.opam/log/raylib-28379-691629.out
### output ###
# ./src/c/vendor/raylib/src/raylib.h:1027:13: warning: "callback" is deprecated: use "caml_callback" instead
# [...]
#       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ./src/c/vendor/raylib/src/raylib.h:1028:13: warning: "callback" is deprecated: use "caml_callback" instead
#  1028 | RLAPI void SetLoadFileTextCallback(LoadFileTextCallback callback); // Set custom file text data loader
#       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ./src/c/vendor/raylib/src/raylib.h:1029:13: warning: "callback" is deprecated: use "caml_callback" instead
#  1029 | RLAPI void SetSaveFileTextCallback(SaveFileTextCallback callback); // Set custom file text data saver
#       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# /opam-tmp/build_3a68e9_dune/ppxc_extract_raylib_types_971446.c: In function ‘ppxc2_raylib_types_8e_af9_structMesh’:
# /opam-tmp/build_3a68e9_dune/ppxc_extract_raylib_types_971446.c:4529:21: warning: comparison of distinct pointer types lacks a cast
#  4529 |   (void) (&ppx__var == &ppxc_raylib_types_8e_af9_boneIds); /* field boneIds in struct Mesh incompatible? */
#       |                     ^~

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build raylib 0.5.1
└─ 
╶─ No changes have been performed

It would be really helpful for me to know what went wrong and how to fix the issue.

tjammer commented 1 year ago

Unfortunately I can't reproduce this with a new switch and the same opam and compiler version. Could you export your opam switch opam switch export FILENAME, so I could try the same versions as you?

The warnings shown in your output are just warnings by the C compiler when building the raylib C library. They shouldn't matter to the OCaml package at all

tjammer commented 1 year ago

I'm closing this issue as I can't reproduce the problem. Feel free to reopen with new information though, I would like to see this sorted out