【问题标题】:OCaml Compile Error: /usr/bin/ld: cannot find -lstrOCaml 编译错误:/usr/bin/ld: 找不到 -lstr
【发布时间】:2012-11-27 12:49:54
【问题描述】:

我正在尝试在 Ubuntu 64 机器上编译 MEGAM Ocaml 库的源代码。

我安装了 OCaml (v 3.12.1),使用 sudo apt-get install ocaml。

我在终端中对解压缩的源代码运行“make”命令时遇到问题,OCaml 返回错误:

/user/bin/ld: cannot find -lstr
collect2: error: ld returned 1 exit status

makefile 正在生成以下两个命令:

 ocamldep *.ml > .depend

运行时没有错误

ocamlc -g -custom -o megam str.cma -cclib -lstr bigarray.cma -cclib -lbigarray unix.cma -cclib -lunix -I /usr/lib/ocaml/caml fastdot_c.c fastdot.cmo intHashtbl。 cmo arry.cmo util.cmo data.cmo bitvec.cmo cg.cmo wsemlm.cmo bfgs.cmo pa.cmo perceptron.cmo radapt.cmo kernelmap.cmo abffs.cmo main.cmo

运行时抛出上述错误。

我尝试从编译命令中删除 -lstr,它停止抛出该特定错误但开始抛出另一个错误 (Reference to undefined global 'Bigarray'),这让我觉得这可能是我在 OCaml 安装期间错过的所有内容,我需要设置的某种 PATH 或参考。

非常感谢任何帮助,即使它只是在黑暗中的一个镜头,因为我真的很难想出任何东西!

【问题讨论】:

    标签: linux ubuntu ocaml nltk


    【解决方案1】:

    The instructions given here 允许我编译没有错误。归结为:

    locate libcamlstr
    

    这告诉我 libcamlstr 可以在 /usr/lib/ocaml (YMMV) 中找到,所以我这样做了:

    cd /usr/lib/ocaml
    sudo ln -s libcamlstr.a libstr.a
    

    然后我就可以编译项目了:

    cd /usr/local/src/cil
    make clean && ./configure && make
    

    【讨论】:

      【解决方案2】:

      你可以改变 makefile 从

      -lstr
      

      到

      -lcamlstr
      

      【讨论】:

        【解决方案3】:

        在 OCaml 错误跟踪器中查看此错误的最后一条评论:

        Bug 5247

        【讨论】:

          猜你喜欢
          • 2014-08-17
          • 1970-01-01
          • 1970-01-01
          • 2023-01-07
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-10-19
          • 1970-01-01
          相关资源
          最近更新 更多