1

我正在尝试从http://people.cs.uchicago.edu/~rbg/latent/编译对象检测程序,但是没有任何运气。

我安装了 64 位 Ubuntu 12.10、32 位 MATLAB 2012a。我也有 gcc 编译器

ivan@ubuntu:~$ gcc --version
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

这是我得到的错误

EDU>> demo
compiling the code...
Warning: You are using gcc version "4.7.2-2ubuntu1)".  The version
     currently supported with MEX is "4.4.6".
     For a list of currently supported compilers see: 
     http://www.mathworks.com/support/compilers/current_release/

/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when       searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when   searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.so when  searching for -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a when searching for -lgomp
/usr/bin/ld: cannot find -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

    mex: link of ' "bin/fv_cache.mexglx"' failed.

Warning: Maybe you need to call fv_cache('unlock') first? 
> In fv_compile at 50
  In compile at 48
  In demo at 5 

Warning: You are using gcc version "4.7.2-2ubuntu1)".  The version
     currently supported with MEX is "4.4.6".
     For a list of currently supported compilers see: 
     http://www.mathworks.com/support/compilers/current_release/

/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status

    mex: link of ' "bin/cascade.mexglx"' failed.

Error using mex (line 206)
Unable to complete successfully.

Error in cascade_compile (line 43)
eval(mexcmd);

Error in compile (line 50)
  cascade_compile(opt, verb);

Error in demo (line 5)
compile;

我怀疑这与缺少 32 位库有关。我是 unix 系统的新手,所以我可能没有包含您需要知道的所有信息。

更新:

新错误看起来像

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.so when searching for -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgomp.a when searching for -lgomp
/usr/bin/ld: cannot find -lgomp
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status

  mex: link of ' "bin/fv_cache.mexglx"' failed.

我试图创建一个符号链接

sudo ln -s /usr/lib/i386-linux-gnu/libc.so.6 /usr/lib/libc.so.6

然而并没有解决问题

4

1 回答 1

0

首先尝试crti在您的系统中查找:

~$ sudo find /usr/ -name crti*
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib32/crti.o

如果它不存在,或者 lib32 版本,请安装libc6-dev

~$ sudo apt-get install libc6-dev

如果存在,请尝试添加库位置:

LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH 
export LIBRARY_PATH

有关相关问题和帮助, 另请参阅Ask UbuntuSO中的这些帖子。

于 2013-02-18T19:28:25.383 回答