babaoreum
babaoreum

Reputation: 23

Include OCaml library with dune

I'm trying to make an OCaml program that uses the Str library

I'm using dune for compiling

My Makefile is

dune build src/myProgram.exe

My dune textfile in the src folder is

(env (_ (flags :standard -w -27-26-32-33)))
(executable (name myProgram) (modules myProgram) (libraries myLib) (modes byte exe))  
(library (name myLib) (modules M1 M2 M3 M4 M5 M6 M7))

My bash error message is :

File "_none_", line 1:  
Error: No implementations provided for the following modules:  
         Str referenced from src/.myProgram.eobjs/native/dune__exe__myProgram.cmx

I don't know how to include this Str library

Upvotes: 1

Views: 346

Answers (1)

Chris
Chris

Reputation: 36536

To put it into an answer, tool want to list str as a library.

(executable 
  (name myProgram) 
  (modules myProgram) 
  (libraries str myLib) 
  (modes byte exe))

Upvotes: 2

Related Questions