我主要按照博客Ubuntu 14.04 LTS 下升级 gcc 到 gcc-4.9、gcc-5 版本的步骤升级gcc。
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get upgrade
sudo apt-get install gcc-5 g++-5
之后出现问题:
gph@gph-pc:~$ sudo apt-get install gcc-5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-5:i386 : Depends: cpp-5:i386 (= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
Depends: libcc1-0:i386 (>= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
Depends: binutils:i386 (>= 2.24) but it is not going to be installed
Depends: libgcc-5-dev:i386 (= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
Depends: libc6:i386 (>= 2.15) but it is not going to be installed
Depends: libgcc1:i386 (>= 1:3.0) but it is not going to be installed
Depends: libgmp10:i386 but it is not going to be installed
Depends: libisl15:i386 (>= 0.15) but it is not going to be installed
Depends: libmpc3:i386 but it is not going to be installed
Depends: libmpfr4:i386 (>= 3.1.3) but it is not going to be installed
Depends: libstdc++6:i386 (>= 4.1.1) but it is not going to be installed
Depends: zlib1g:i386 (>= 1:1.1.4) but it is not going to be installed
Recommends: libc6-dev:i386 (>= 2.13-0ubuntu6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
请问有人知道如何解决吗?
已经百度和Google过相关的问题了,还是没有解决,请各位提供帮助,谢谢!
最后通过本地编译安装的方式安装了gcc5.3.0,但是在编译一个代码的时候出现如下错误:
.build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char.build_release/lib, std/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std:::__cxx11:::basic_string<charchar_traits, std<::char_traits<charchar>, std::allocator<char> > >, std::allocator<boost::sub_match<>__gnu_cxx::__normal_iterator<, .build_release/tools/get_image_size.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':
get_image_size.cpp:(.text._ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x41): undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
.build_release/tools/get_image_size.o: In function `main':
get_image_size.cpp:(.text.startup+0x66): undefined reference to `google::SetUsageMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
get_image_size.cpp:(.text.startup+0x722): undefined reference to `caffe::GetImageSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int*, int*)'
。 。 。 。 。 。
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/device_query.bin] Error 1
这又是什么问题。。。?