c++应该已经安装。
关闭问题。
--------------------更新分割线,以下旧版--------------------
系统:ubuntu 12.04
gcc源码下载于官网镜像http://mirrors-usa.go-parts.com/gcc/releases/gcc-4.7.4/
看图gcc应该是安装成功了...吧(另:明明下的是4.7.4最后4.6.3?)
那c++究竟有没有呢?!
图一
图二
--------------------更新分割线,以下旧版--------------------
怎样源码安装gcc g++?(我知道有网环境下直接命令 sudo apt-get install build-essential)
情况是这样的:
1.无网络,无法apt-get,wget等(其实有的,但是只能被动接受),之前的安装都是上传tag.gz解压安装的
2.最初只是想安装apache2.4,需要用到pcre,然后安之,提示错误 You need a C++ compiler for C++ support
3.百度后根据网上教程成功安装了gcc(man gcc,gcc -v 有效),但是错误仍在,估计是还要安装g++(c++?)
然后问题来了: g++(c++?)怎么安装呢 ?和gcc一样吗?
所以: 求gcc源码包及简要安装方式。
大家讲道理2017-04-22 08:58:11
The gcc source code package already contains g++. After confirming the compilation, execute sudo make install
Since you are using ubuntu, it’s easy. First, let’s introduce a simple method:
1. Go to the ubuntu packages website to download build-essential. You can also search for other software packages. Select your distribution. If If you are not sure what the codename of your system is, see below
//使用命令:
cat /etc/lsb-release
//输出以下:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty //trusty就是代号
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
2. Select amd64 or x86, click on any one on the opened image page, and download the deb package directly. Find a way to get this deb package to your ubuntu target machine (without network, is it still possible? No U disk;)
3. Perform the installation on the target machine: sudo dpkg -i xxxxxx.deb
Done. If the installation process prompts an error and other software packages are needed, then continue to search from the ubuntu packages website and continue the installation.
The following method is suitable for installing a specified version, manually configuring features, not installing into the system, not wanting to pollute the system, etc.:
If you want to install any software (or project), just go directly to the official website of that software or visit the website where the software is located. If there is an official github source code repository (such as https://gcc.gnu.org/), just read the above documentation directly. If there is no official website, after downloading the source code package, read the README(.txt,. md), INSTALL (.txt, .md) and other files, which contain compilation, installation and even usage instructions. Compilation is nothing more than autoconf and Makefile related things. Some use cmake, gradle, etc., which are all project management. Tools, after taking the time to learn about autoconf and Makefile (at least know how to use them), installing the software is a piece of cake.