ocamlfind cannot see installed package

后端 未结 2 1809
醉话见心
醉话见心 2021-02-06 04:15

I wanted to compile my project using command:

ocamlfind ocamlopt -package ocamlnet -package batteries -package unix -linkpkg oauth.ml

but I\'m

相关标签:
2条回答
  • 2021-02-06 04:37

    Do a:

    eval $(opam config env)
    

    That should fix the problem.

    # Edit 1:

    If it still does not work remove the dir

    /home/user/.opam/4.00.1

    and try it again.

    0 讨论(0)
  • 2021-02-06 04:39

    I'm making answer because of limit in comments and partial results I've made. Here is the result of 'grep -r 'ocamlnet' *' at '~/.opam' directory: http://pastebin.com/8cJqMXDY by looking at lines 1-90 we may conclude that there is actually no ocamlnet library at all (or I'm looking for it in wrong place - but as I wrote in comment everything were installed using opam - I'd be glad to hear some opinions on this subject). These suspicions may be partially confirmed in two ways:

    1. in fact in lines 1-90 we've all binaries of ocamlnet components (http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-main/index.html)
    2. lines 90-* doesn't seem like something other than some files needed to manage this package using opam. E.g.

      ~/.opam/repo/default/packages/ocamlnet$ tree -r .
      .
      ├── ocamlnet.3.7.3
      │   ├── url
      │   ├── opam
      │   ├── files
      │   │   └── ocamlnet.install
      │   └── descr
      ├── ocamlnet.3.6.5
      │   ├── url
      │   ├── opam
      │   ├── files
      │   │   ├── ocamlnet.install
      │   │   ├── netpop.patch
      │   │   ├── nethttpd_types.patch
      │   │   └── cloexec.patch
      │   └── descr
      ├── ocamlnet.3.6.3
      │   ├── url
      │   ├── opam
      │   ├── files
      │   │   └── ocamlnet.install
      │   └── descr
      ├── ocamlnet.3.6.0
      │   ├── url
      │   ├── opam
      │   ├── files
      │   │   ├── ocamlnet-ocaml4.diff
      │   │   └── ocamlnet.install
      │   └── descr
      ├── ocamlnet.3.5.1
      │   ├── url
      │   ├── opam
      │   ├── files
      │   │   └── ocamlnet.install
      │   └── descr
      └── ocamlnet.3.2.1
          ├── url
          ├── opam
          ├── files
          │   └── ocamlnet.install
          └── descr
      

    I do not have a sufficiently large knowledge to go into it deeper but it looks for me like that ocamlnet become just a shortcut for a few another packages used by opam. Especially that after changing

    -package ocamlnet
    

    to exact module which I'm using

    -package netstring
    

    everything has compiled fine. I'm still open to any other solutions or explenations for the curious case of ocamlnet package (and Michael's hints) B).

    0 讨论(0)
提交回复
热议问题