Im on Debian GNU/Linux 9 (stretch) 64-bit with OCaml version 4.05.0 and I want to compile the following file helloworld.ml into machine code using ocamlopt. To be more precise I have a .ml filethat which contains
print_string “Hello world!\n”;;
but is otherwise empty. I cd into, say …/folder than run
xx~$ ocamlopt …/folder/helloworld.ml
and I get a file helloworld.o … On debian I chmod this file to be executeable. I execute the file
xx~$ …/folder/helloworld.o
and I get the error massage:
bash: …/folder/hello_world.o: cannot execute binary file: Exec format error
I think this means that the machine code is for another machine. Maybe a 64bit/32bit mismatch. I don’t know. Am I doing something wrong?
Note: Since I needed the latest Ocaml version, which is not in the debian repository, I might have installed a 32bit version. Can I check that?