“链接期间出错”用于用 Ocaml 编写的 Java 编译器

发布于 2024-11-15 23:47:02 字数 664 浏览 1 评论 0原文

我找到了源代码编写的Java编译器Ocaml 应该可以工作。

但是当我执行 make 时,它​​完成时出现错误:

unzip.o: In function `camlUnzip__59':
(.data+0x540): undefined reference to `camlzip_deflateEnd'
unzip.o: In function `camlUnzip__59':
(.data+0x544): undefined reference to `camlzip_deflate'
unzip.o: In function `camlUnzip__59':
(.data+0x548): undefined reference to `camlzip_deflateInit'
collect2: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
make: *** [javacx] Error 2

奇怪的是,文件夹中甚至不存在文件“caml_startup”。有人可以帮忙吗?非常感谢。

I have found a source of Java compiler written in Ocaml which should work.

But when I do make, it finished with an error:

unzip.o: In function `camlUnzip__59':
(.data+0x540): undefined reference to `camlzip_deflateEnd'
unzip.o: In function `camlUnzip__59':
(.data+0x544): undefined reference to `camlzip_deflate'
unzip.o: In function `camlUnzip__59':
(.data+0x548): undefined reference to `camlzip_deflateInit'
collect2: ld returned 1 exit status
File "caml_startup", line 1, characters 0-1:
Error: Error during linking
make: *** [javacx] Error 2

It is odd that the file "caml_startup" even does not exist in the folder. Could anyone help? Thank you very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红玫瑰 2024-11-22 23:47:02

caml_startup 是 OCaml 运行时的一部分。

该项目的网站提到它可以与 OCaml 3.09 一起使用,该版本已经很旧了。它对我来说适用于 3.10(它仍然很旧;最新版本是 3.12) - 也许它只是不适用于更新的版本。

但是,作为第一个猜测,我会尝试简单地从 unzip.ml 中删除这些定义 - 它们从未被调用,并声明实际未实现的外部例程(而其他 external > unzip.ml 中的例程在 zlib.c 中实现):

external deflate_init: int -> bool -> stream = "camlzip_deflateInit"
external deflate:
  stream -> string -> int -> int -> string -> int -> int -> flush_command
         -> bool * int * int
  = "camlzip_deflate_bytecode" "camlzip_deflate"
external deflate_end: stream -> unit = "camlzip_deflateEnd"

caml_startup is part of the OCaml runtime.

The project's website mentions that it works with OCaml 3.09, which is quite old. It worked for me with 3.10 (which is still quite old; latest release is 3.12) - maybe it just doesn't work with more recent versions.

However, as a first guess, I would try simply deleting these definitions from unzip.ml - they are never called, and declare external routines which are not actually implemented (whereas other external routines in unzip.ml are implemented in zlib.c):

external deflate_init: int -> bool -> stream = "camlzip_deflateInit"
external deflate:
  stream -> string -> int -> int -> string -> int -> int -> flush_command
         -> bool * int * int
  = "camlzip_deflate_bytecode" "camlzip_deflate"
external deflate_end: stream -> unit = "camlzip_deflateEnd"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文