开发者

How to install gcc-4.1 on Ubuntu 10.10

1) I need gcc-4.1 for Matlab mex usage, but I can't get it installed fully with apt-get install:

The following packages have unmet dependencies:
libstdc++6-4.1-dev : Depends: gcc-4.1-base (= 4.1.2-27ubuntu1) but 4.1.2-29ubuntu1 is to be installed
Depends: g++-4.1 (= 4.1.2-27ubuntu1) but it is not going to be installed
E: Broken packages

2) I now only have gcc-4.1-base and -multilib installed. When compiling mex file:

/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status

Some开发者_如何转开发thing is wrong with libstdc++6-4.1-dev. So any easier fix than compiling by myself?

Thanks


I assume you use x64 version Ubuntu and your Matlab version is also 64bit. There are two ways that may solve your problem mentioned in 2):

  1. Open mexopts.sh (located in yourhome/.matlab/MATLAB VERSION/ directory), and comment CLIBS="CLIBS -lstdc++" for glnxa64.
  2. Check whether libstdc++.so. exists in /usr/lib directory. If not, create a symbolic link /usr/lib/libstdc++.so to MATLABROOT/sys/os/glnxa64/libstdc++.so.6.0.xx (xx is a number that may change with matlab version).


I wouldn't compile it myself. I remember how long that takes (it's one the longest parts of building any Linux system)...

So I presume you don't have a fully functional GCC right now? I got this to install from apt-get in Ubuntu 10.10 x64...

Okay, so you have broken dependencies, eh? I know this is not elegant, but try downloading the deb files manually (http://packages.ubuntu.com/maverick/gcc-4.1 for 10.10 or http://packages.ubuntu.com/lucid/gcc-4.1 for 10.04), save them to a folder, cd into the folder from Terminal, and run this for each package:

dpkg -i package.deb

There is a more elegant way to do this, but I just don't know it...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜