I wanted to compile my project using command:
ocamlfind ocamlopt -package ocamlnet -package batteries -package unix -linkpkg oauth.ml
but I\'m
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.
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:
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).