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

Error: "in expansion of macro 'String_val'" in consts_stub.c #72

Closed
notSeabasschin12 opened this issue Mar 30, 2021 · 3 comments
Closed

Comments

@notSeabasschin12
Copy link

notSeabasschin12 commented Mar 30, 2021

When I try installing tsdl through opam install tsdl, I get the following error:

`[ERROR] The compilation of tsdl failed at "/home/sebastianguo/.opam/opam-init/hooks/sandbox.sh`
`        build ocaml pkg/pkg.ml build --pinned false".`
`#=== ERROR while compiling tsdl.0.9.8 =========================================#`
`# context     2.0.4 | linux/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#f736f159`
`# path        ~/.opam/cs3110-2021sp/.opam-switch/build/tsdl.0.9.8`
`# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --pinned false`
`# exit-code   1`
`# env-file    ~/.opam/log/tsdl-26286-d2c37b.env`
`# output-file ~/.opam/log/tsdl-26286-d2c37b.out`
`### output ###`
`# [...]`
`# support/consts_stub.c:1031:16: note: in expansion of macro ‘String_val’`
`#    char *outf = String_val (fname);`
`#                 ^~~~~~~~~~`
`# Command exited with code 2.`
`# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'`
`#      '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'`
`#      'README.md' 'src/tsdl.a' 'src/tsdl.cmxs' 'src/tsdl.cmxa' 'src/tsdl.cma'`
`#      'src/tsdl.cmx' 'src/tsdl.cmi' 'src/tsdl.mli' 'src/tsdl_consts.cmx'`
`#      'src/tsdl_top.a' 'src/tsdl_top.cmxs' 'src/tsdl_top.cmxa'`
`#      'src/tsdl_top.cma' 'src/tsdl_top.cmx' 'src/tsdl_top_init.ml'`
`#      'src/dlltsdl.so' 'src/libtsdl.a' 'doc/index.mld' 'README.md'`
`#      'CHANGES.md' 'test/min.ml' 'test/minc.c']: exited with 10`

I saw a similar error on GitHub that recommended changing the char to an unsigned char (ocaml/ocaml#1274). Has anyone also experienced this?

@dbuenzli
Copy link
Owner

Somehow it seems a const is missing. It's a bit odd it doesn't seem to have shown up so far.

Could you please try to:

opam pin add tsdl --dev 

and confirm that 9e08959 works for you.

@clecat
Copy link

clecat commented Jun 4, 2021

Hello here, I had the same problem and tried to use your patch. It seems to have corrected the problem with String_val, however, the same issue seems to keep on with other variables.

However, I just happened to check my installed version of libsdl and it was 2.0.8 which is under the required 2.0.9.
After installing from the source the version 2.0.14 (as my package manager was blocked with 2.0.8), I was able to successfully install tsdl without your last commit.

So it might be the same situation for @notSeabasschin12 and it would explain why it didn't show up until now

@dbuenzli
Copy link
Owner

I guess this is solved then.

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

No branches or pull requests

3 participants