Git Product home page Git Product logo

Comments (5)

BarronRauEA avatar BarronRauEA commented on August 18, 2024

Did you install both gcc-mingw-w64-i686 and gcc-mingw-w64-x86-64 as listed in Prerequisites?

from opam-cross-windows.

jackprogramsjp avatar jackprogramsjp commented on August 18, 2024
jackprograms@pop-os:~$ opam install ocaml-windows
The following actions will be performed:
  ∗ install ocaml-windows32 4.11.2 [required by ocaml-windows]
  ∗ install ocaml-windows   4.11.2
===== ∗ 2 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ocaml-windows32.4.11.2] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of ocaml-windows32 failed at "/home/jackprograms/.opam/opam-init/hooks/sandbox.sh build /bin/sh ./build.sh i686-w64-mingw32".

#=== ERROR while compiling ocaml-windows32.4.11.2 =============================#
# context     2.0.5 | linux/x86_64 | ocaml-system.4.08.1 | git://github.com/ocaml-cross/opam-cross-windows
# path        ~/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build /bin/sh ./build.sh i686-w64-mingw32
# exit-code   2
# env-file    ~/.opam/log/ocaml-windows32-19868-e0ba4f.env
# output-file ~/.opam/log/ocaml-windows32-19868-e0ba4f.out
### output ###
# [...]
# /home/jackprograms/.opam/default/lib/flexdll-windows/flexlink -chain mingw -stack 16777216 -link -static-libgcc -exe -link "-municode" -g -o ocamlrund.exe prims.o libcamlrund.a -lws2_32 -lversion 
# /home/jackprograms/.opam/default/lib/flexdll-windows/flexlink -chain mingw -stack 16777216 -link -static-libgcc -exe -link "-municode" -o ocamlruni.exe prims.o libcamlruni.a -lws2_32 -lversion 
# make[1]: Leaving directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/runtime'
# cp runtime/ocamlrun.exe boot/ocamlrun.exe
# make -C stdlib  \
#   CAMLC='$(BOOT_OCAMLC) -use-prims ../runtime/primitives' all
# make[1]: Entering directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/stdlib'
# /home/jackprograms/.opam/default/bin/ocamlrun ../boot/ocamlc -use-prims ../runtime/primitives -strict-sequence -absname -w +a-4-9-41-42-44-45-48 -g -warn-error A -bin-annot -nostdlib -safe-string -strict-formats  -nopervasives -c camlinternalFormatBasics.mli
# make[1]: /home/jackprograms/.opam/default/bin/ocamlrun: Command not found
# make[1]: *** [Makefile:209: camlinternalFormatBasics.cmi] Error 127
# make[1]: Leaving directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/stdlib'
# make: *** [Makefile:153: coldstart] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocaml-windows32 4.11.2
└─ 
╶─ No changes have been performed

I installed the mingw in the Prerequisites, but now still an error. ocamlrun is in my /usr/bin, not in my opam, which I don't understand why it should be in the opam bin.

I made a link target, so ocamlrun is added in the opam bin, so it should target to the /usr/bin/ocamlrun.

I ran the opam install ocaml-windows again, but another error...

jackprograms@pop-os:~$ opam install ocaml-windows
The following actions will be performed:
  ∗ install ocaml-windows32 4.11.2 [required by ocaml-windows]
  ∗ install ocaml-windows   4.11.2
===== ∗ 2 =====
Do you want to continue? [Y/n] y

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ocaml-windows32.4.11.2] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of ocaml-windows32 failed at "/home/jackprograms/.opam/opam-init/hooks/sandbox.sh build /bin/sh ./build.sh i686-w64-mingw32".

#=== ERROR while compiling ocaml-windows32.4.11.2 =============================#
# context     2.0.5 | linux/x86_64 | ocaml-system.4.08.1 | git://github.com/ocaml-cross/opam-cross-windows
# path        ~/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build /bin/sh ./build.sh i686-w64-mingw32
# exit-code   2
# env-file    ~/.opam/log/ocaml-windows32-24489-e0ba4f.env
# output-file ~/.opam/log/ocaml-windows32-24489-e0ba4f.out
### output ###
# [...]
# /home/jackprograms/.opam/default/lib/flexdll-windows/flexlink -chain mingw -stack 16777216 -link -static-libgcc -exe -link "-municode" -g -o ocamlrund.exe prims.o libcamlrund.a -lws2_32 -lversion 
# /home/jackprograms/.opam/default/lib/flexdll-windows/flexlink -chain mingw -stack 16777216 -link -static-libgcc -exe -link "-municode" -o ocamlruni.exe prims.o libcamlruni.a -lws2_32 -lversion 
# make[1]: Leaving directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/runtime'
# cp runtime/ocamlrun.exe boot/ocamlrun.exe
# make -C stdlib  \
#   CAMLC='$(BOOT_OCAMLC) -use-prims ../runtime/primitives' all
# make[1]: Entering directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/stdlib'
# /home/jackprograms/.opam/default/bin/ocamlrun ../boot/ocamlc -use-prims ../runtime/primitives -strict-sequence -absname -w +a-4-9-41-42-44-45-48 -g -warn-error A -bin-annot -nostdlib -safe-string -strict-formats  -nopervasives -c camlinternalFormatBasics.mli
# Fatal error: the file '../boot/ocamlc' has not the right magic number: expected Caml1999X025, got Caml1999X028
# make[1]: *** [Makefile:209: camlinternalFormatBasics.cmi] Error 2
# make[1]: Leaving directory '/home/jackprograms/.opam/default/.opam-switch/build/ocaml-windows32.4.11.2/stdlib'
# make: *** [Makefile:153: coldstart] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build ocaml-windows32 4.11.2
└─ 
╶─ No changes have been performed

It is some weird error that I don't understand.

Can someone explain why this fails to build? What can I do?

from opam-cross-windows.

BarronRauEA avatar BarronRauEA commented on August 18, 2024

Are you trying to install 64 bit? If so, try getting rid of the link target and run opam install ocaml-windows64.

from opam-cross-windows.

jackprogramsjp avatar jackprogramsjp commented on August 18, 2024

I put my OCaml compiler to 4.11.2, and it worked. Other versions like 4.11.1 and 4.08 did not work and errored, so I find the README.md misleading. Thank you for your help @BarronRauEA

from opam-cross-windows.

BarronRauEA avatar BarronRauEA commented on August 18, 2024

from opam-cross-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.