# Library not found

**URL:** <https://discuss.ocaml.org/t/library-not-found/13481>\
**Category:** Learning\
**Tags:** dune, build\
**Created:** [November 22, 2023, 10:01pm UTC](https://discuss.ocaml.org/t/library-not-found/13481 "2023-11-22T22:01:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NAlec](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NAlec](https://discuss.ocaml.org/u/NAlec)\
**Post date:** [November 22, 2023, 10:01pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/1 "2023-11-22T22:01:23Z")

</div>

I have the sequence below which I synthesize as :

I have installed the library stdint  
I have added Stdint in my dune file :

```auto
(executable
 (public_name Bataille)
 (name main)
 (libraries Bataille ANSITerminal Stdint))

```

and when I build my programm, dune does not find Stdint …

Help appreciated (again).

```auto
PS H:\OCaml\Bataille> opam show stdint

<><> stdint: information on all versions ><><><><><><><><><><><><><><><><><><><>
name stdint
all-installed-versions 0.7.2 [playground]
all-versions 0.3.0-0 0.4.0 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.1 0.7.2

<><> Version-specific details <><><><><><><><><><><><><><><><><><><><><><><><><>
version 0.7.2
repository fdopen-mingw-1.2.0-4.14.0
url.src "https://github.com/andrenth/ocaml-stdint/releases/download/0.7.2/stdint-0.7.2.tbz"
url.checksum "sha256=1560198d8bc9c7af3ea952c40dabe82666694210ecc3fdf9bbfeb43211e977e6"
             "sha512=b0319c2e7490e58effc7a01f2c5635d3468e501741478249e012dda039729609f7bb7d3cb6239eed709f1c043bc23a1c6cff777b174d215fbf6f2eba9f0d023d"
homepage "https://github.com/andrenth/ocaml-stdint"
doc "https://andrenth.github.io/ocaml-stdint/"
bug-reports "https://github.com/andrenth/ocaml-stdint/issues"
authors "Andre Nathan <andre@digirati.com.br>"
             "Markus W. Weissmann <markus.weissmann@in.tum.de>"
maintainer "Markus W. Weissmann <markus.weissmann@in.tum.de>"
license "MIT"
depends "dune" {>= "3.0"} "ocaml" {>= "4.03"} "qcheck" {with-test} "odoc" {with-doc}
synopsis Signed and unsigned integer types having specified widths
description The stdint library provides signed and unsigned integer types of various fixed
             widths: 8, 16, 24, 32, 40, 48, 56, 64 and 128 bit.
             This interface is similar to Int32 and Int64 from the base library but provides
             more functions and constants like arithmetic and bit-wise operations, constants
             like maximum and minimum values, infix operators conversion to and from every
             other integer type (including int, float and nativeint), parsing from and
             conversion to readable strings (binary, octal, decimal, hexademical), conversion
             to and from buffers in both big endian and little endian byte order.
PS H:\OCaml\Bataille> dune --version
3.6.2
PS H:\OCaml\Bataille> ocaml --version
The OCaml toplevel, version 4.14.0
PS H:\OCaml\Bataille> dune build
File "bin/dune", line 4, characters 34-40:
4 | (libraries Bataille ANSITerminal Stdint))
                                      ^^^^^^
Error: Library "Stdint" not found.
-> required by _build/default/bin/main.exe
-> required by _build/install/default/bin/Bataille.exe
-> required by _build/default/Bataille.install
-> required by alias all
-> required by alias default
File "bin/Bataille.ml", line 75, characters 27-28:
75 | s.nb_parties <- Uint8.+ s.nb_parties one;
                                ^
Error: Syntax error

```

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [November 22, 2023, 10:23pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/2 "2023-11-22T22:23:12Z")

</div>

The library is called `stdint` not `Stdint`. If you need to lookup library names have a look at `ocamlfind list`.

---

<div class="post-metadata">

**Author:** ![Chet\_Murthy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/chet_murthy/32/1501_2.png) [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Post date:** [November 22, 2023, 10:25pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/3 "2023-11-22T22:25:57Z")

</div>

Was just coming here to say that. But also, the way I learned it (b/c I’m not a dune user at all).

1. look up the stdint github repo
2. look at their tests
3. they use dune!
4. [https://github.com/andrenth/ocaml-stdint/blob/master/tests/dune](https://github.com/andrenth/ocaml-stdint/blob/master/tests/dune)

```auto
(test
 (name stdint_test)
 (libraries str stdint qcheck)
 (flags (:standard -w -32)))

```

Well-written packages come with copious tests, and you (I also) can look at those tests to see how to use 'em.

---

<div class="post-metadata">

**Author:** ![NAlec](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NAlec](https://discuss.ocaml.org/u/NAlec)\
**Post date:** [November 23, 2023, 9:43pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/4 "2023-11-23T21:43:30Z")

</div>

Thank you all for your replies. Nevertheless, this did not solve my issue though. Ocamlfind did find the stdint library (in lowercase) and the correct version:

```auto
PS H:\OCaml\Bataille> (& opam env) -split '\r?\n' | ForEach-Object { Invoke-Expression $_ }
PS H:\OCaml\Bataille> dune build
File "bin/dune", line 4, characters 34-39:
4 | (libraries Bataille ANSITerminal sdint))
                                      ^^^^^
Error: Library "sdint" not found.
-> required by _build/default/bin/main.exe
-> required by _build/install/default/bin/Bataille.exe
-> required by _build/default/Bataille.install
-> required by alias all
-> required by alias default
File "bin/Bataille.ml", line 75, characters 27-28:
75 | s.nb_parties <- Uint8.+ s.nb_parties one;
                                ^
Error: Syntax error

```

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [November 23, 2023, 10:25pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/5 "2023-11-23T22:25:41Z")

</div>

> [@NAlec](#):
>
> `4 | (libraries Bataille ANSITerminal sdint))`

s **t** dint :–)

Other than that you really have a syntax error in `Bataille.ml`, `Uint8.+` is not valid syntax. Maybe you meant `Uint8.( + )` if there’s such an operator in the `Uint8` module.

---

<div class="post-metadata">

**Author:** ![NAlec](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@NAlec](https://discuss.ocaml.org/u/NAlec)\
**Post date:** [November 24, 2023, 6:11pm UTC](https://discuss.ocaml.org/t/library-not-found/13481/6 "2023-11-24T18:11:33Z")

</div>

I hate asking questions for that kind of error. I was sure I tried with “stdint” before asking here …

Thanks, and yes, I had a typo for which I did not know the exact spelling. solved now.

As Boileau used to say : _go back to your work again_
