使用Ocamlnet构建OCaml项目

时间:2014-03-04 14:15:31

标签: debian ocaml ocamlbuild

我正在OCaml做一个项目而我正在尝试使用Ocamlnet。我使用ocamlbuild进行构建。这是我的构建命令行:

ocamlbuild -use-ocamlfind -pkgs threads,yojson,str,postgresql,netcgi2 \
  -cflags -g,-thread -lflags -g,-thread -classic-display test.byte

当我构建项目时,我收到此链接错误:

+ /usr/bin/ocamlfind ocamlc -g -thread -linkpkg -package netcgi2 -package postgresql -package str -package threads -package yojson cgi.cmo data.cmo util.cmo persist.cmo setup.cmo test.cmo -o test.byte
File "_none_", line 1, characters 0-1:
Error: Error while linking /usr/lib/ocaml/netsys/netsys.cma(Netsys_posix):
The external function `netsys_have_sem' is not available
Command exited with code 2.

我没有直接使用Netsys_posix中的任何内容,但我的代码引用了NetchannelsNetcgi_cgi

我使用Debian Wheezy(7)并使用distro软件包管理器安装软件包。 OCaml的版本是3.12.1。这是我安装的与OCaml相关的软件包的列表,如果它是相关的(对于在一条线上一起运行它们而道歉,但是将它们放在自己的线上似乎过度使用了空间) :

libapache2-mod-ocamlnet libbatteries-ocaml-dev libbatteries-ocaml-doc libbiniou-ocaml libbiniou-ocaml-dev libcalendar-ocaml libcalendar-ocaml-dev libcamomile-ocaml-data libcamomile-ocaml-dev libcryptgps-ocaml-dev libcryptokit-ocaml libcryptokit-ocaml-dev libcsv-ocaml-dev libderiving-ocsigen-ocaml libderiving-ocsigen-ocaml-dev libeasy-format-ocaml libeasy-format-ocaml-dev libeliom-ocaml libeliom-ocaml-dev libfindlib-ocaml libfindlib-ocaml-dev libjs-of-ocaml libjs-of-ocaml-dev liblwt-ocaml liblwt-ocaml-dev liblwt-ocaml-doc liblwt-ssl-ocaml liblwt-ssl-ocaml-dev libnethttpd-ocaml-dev libocamlnet-ocaml libocamlnet-ocaml-dev libocamlnet-ocaml-doc libocsigen-ocaml libocsigen-ocaml-doc libocsigen-xhtml-ocaml-dev libocsigenserver-ocaml libocsigenserver-ocaml-dev libpcre-ocaml libpcre-ocaml-dev libpostgresql-ocaml libpostgresql-ocaml-dev libreact-ocaml libreact-ocaml-dev libsqlite3-ocaml libsqlite3-ocaml-dev libssl-ocaml libssl-ocaml-dev libtext-ocaml libtext-ocaml-dev libtyxml-ocaml libtyxml-ocaml-dev libyojson-ocaml libyojson-ocaml-dev libzip-ocaml libzip-ocaml-dev ocaml ocaml-base ocaml-base-nox ocaml-batteries-included ocaml-findlib ocaml-interp ocaml-nox ocamlduce ocamlduce-base

如何让我的构建工作?

这是我的错误(在我的构建中)还是Debian打包错误?


更新

我下载了最新的OCaml(4.01.0)和OPAM(1.1.1),从源代码构建它们并将它们安装在/ opt中,然后使用OPAM安装所需的库。现在我得到了一个非常相似的结果,但命名了一个不同的缺失函数:

+ ocamlfind ocamlc -g -thread -linkpkg -package netsys -package netcgi2 -package postgresql -package str -package yojson -package threads cgi.cmo data.cmo util.cmo persist.cmo setup.cmo test.cmo -o test.byte
File "_none_", line 1:
Error: Error while linking /home/nate/.opam/system/lib/netsys/netsys.cma(Netsys_posix):
The external function `caml_ba_dim_1' is not available
Command exited with code 2.

0 个答案:

没有答案