"Unbound module Pervasives" error when using OCaml build system in Sublime Text 3

largecats

I'm trying to create a build system for OCaml in sublime text 3 on Windows 8.1. I installed OCaml via opam in Cygwin and typed the following into the OCaml.sublime-build file:

{
"cmd": ["C:/OCaml64/home/LENOVO/.opam/4.05.0+mingw64c/bin/ocaml.exe", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.ml"
}

I'm trying the build system out with a test.ml that contains print_endline "hello world";;. I can run the command directly from the terminal with the ocaml interactive command line or using ocaml test.ml. But when I open the file in Sublime Text 3 and run Ctrl-B, I get the following error:

File "command line", line 1:
Error: Unbound module Pervasives

I searched for this error online but could not find much that applies to my situation. Any help is much appreciated!

360NS

I've had the same problem with OcaIDE under Eclipse, if you installed Ocaml following this tutorial
then this solution should work for you too, simply from Cygwin terminal type:

ocaml-env-win -- "<insert the path to sublime text>".

This should launch Sublime Text with the proper environment settings.
Source : https://fdopen.github.io/opam-repository-mingw/ocaml-env/#program-startup.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related