tjammer / raylib-ocaml

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

unable to build raylib 0.5.1 #25

Closed raegnald closed 2 years ago

raegnald commented 2 years ago

Hi, I've tried to build the latest version of raylib-ocaml from opam (with opam install raylib) but gave me this error:

[ERROR] The compilation of raylib.0.5.1 failed at "dune build -p raylib -j 7 @install".

#=== ERROR while compiling raylib.0.5.1 =======================================#
# context     2.1.2 | linux/x86_64 | ocaml.4.13.1 | https://opam.ocaml.org#08cbb825
# path        ~/.opam/default/.opam-switch/build/raylib.0.5.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p raylib -j 7 @install
# exit-code   1
# env-file    ~/.opam/log/raylib-77462-4dbee7.env
# output-file ~/.opam/log/raylib-77462-4dbee7.out
### output ###
# [...]
# 'libraylib.so' -> 'libraylib.so.400'
# make: Leaving directory '/home/ronaldo/.opam/default/.opam-switch/build/raylib.0.5.1/_build/default/src/c/vendor/raylib/src'
# (cd _build/default && /home/ronaldo/.opam/default/bin/ppx_cstubs src/c/constants/raylib_constants.ml -o src/c/constants/raylib_generated_constants.ml -I ./src/c/vendor/raylib/src)
# File "src/c/constants/raylib_constants.ml", line 5, characters 4-43:
# 5 |     | Vsync_hint [@cname "FLAG_VSYNC_HINT"]
#         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: constant extraction failed for unknown reasons
# (cd _build/default && /home/ronaldo/.opam/default/bin/ppx_cstubs src/c/types/raylib_types.ml -o src/c/types/raylib_generated_types.ml -I ./src/c/vendor/raylib/src)
# /opam-tmp/build_b735f4_dune/ppxc_extract_raylib_types_d02494.c: In function ‘ppxc2_raylib_types_8e_af9_structMesh’:
# /opam-tmp/build_b735f4_dune/ppxc_extract_raylib_types_d02494.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? */
#       |                     ^~
tjammer commented 2 years ago

That's strange. It looks like ppx_cstubs fails on your build. Unfortunately I cannot reproduce this locally. I tried both with the ppx_cstubs I had installed (0.6.xx) and the latest (0.7) and both builds works. The CI here on github also build fine :(

What version of ppx_cstubs are you using? Maybe you can try to reinstall it on your machine

raegnald commented 2 years ago

I was using ppx_cstubs 0.7.0 and by downgrading it to 0.6.1 it worked. Thanks!