Thedudeabides
Thedudeabides

Reputation: 93

Unbound module error in dune project even with library specified in build config

let read_file path =
  In_channel.with_open_bin path In_channel.input_all

let solve input = input

let () =
  read_file "input.txt"
  |> solve
  |> print_endline

I am currently trying to run this code but keep running into unbound module In_channel error, I referred to similar threads, it seemed like the solution was to create a local switch and I installed core/bench/utop locally , I also added core as part of build config for the executable. Still it says unbound module. The current status of the folder is below, /dune does call core under libraries. The code is part of main.ml

I am using emacs, I dont know if that matters.

Current project folder setup

Thanks in advance.

Upvotes: 0

Views: 68

Answers (1)

octachron
octachron

Reputation: 18912

The In_channel module was added to the standard library in OCaml 4.14 . You are probably using an older version of OCaml. You can upgrade to the latest stable version with

opam switch create 5.2.1

Upvotes: 0

Related Questions