无法配置C编译器 [英] could not configure a c compiler

查看:798
本文介绍了无法配置C编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用编译一些库的 GCC 4.7 的(这是我刚刚从4.6.3升级后,不知何故,抱怨C编译器:

  /家庭/ rtbkit /平台DEPS /节点/ W脚本:263:错误:无法配置C编译器!
使[1]:进入目录`/家庭/ rtbkit /平台DEPS /节点
项目未配置(运行'WAF配置的第一个)
使[1]:*** [程序]错误1
使[1]:目标'都'不是因为错误重拍。
使[1]:离开目录`/家庭/ rtbkit /平台DEPS /节点
使[1]:进入目录`/家庭/ rtbkit /平台DEPS /节点
项目未配置(运行'WAF配置的第一个)
使[1]:*** [程序]错误1
使[1]:目标'都'不是因为错误重拍。
使[1]:离开目录`/家庭/ rtbkit /平台DEPS /节点
使[1]:进入目录`/家庭/ rtbkit /平台DEPS /节点
项目未配置(运行'WAF配置的第一个)
使[1]:*** [程序]错误1
使[1]:离开目录`/家庭/ rtbkit /平台DEPS /节点安装
使[1]:进入目录`/家庭/ rtbkit /平台DEPS /节点
项目未配置(运行'WAF配置的第一个)
使[1]:*** [安装]错误1
使[1]:离开目录`/家庭/ rtbkit /平台DEPS /节点
CP:目标`/家庭/ rtbkit /本地/包括/节点'不是一个目录
使:*** [install_node]错误1


解决方案

GCC-4.7可能无法设置为自动默认。根据您的操作系统版本,你可能需要从像PPA另一个归档得到4.7版本。这是Ubuntu的:

添加一个归档的apt-get安装python的工具:

 根@投标人:〜#apt-get的安装python软件的属性

然后添加PPA存档:

 根@投标人:〜#附加的apt-库PPA:Ubuntu的工具链-R /测试

请确保没有现有的链接:

 根@投标人:〜#更新替代品--remove-gcc的所有
根@投标人:〜#更新替代品--remove-所有G ++

所有的档案包的更新列表:

 根@投标人:〜#apt-get的更新

安装4.7版本的gcc和g ++:

 根@投标人:〜#的apt-get安装GCC-4.7
根@投标人:〜#apt-get的安装-f
根@投标人:〜#的apt-get安装G ++ - 4.7

添加默认链接到新的版本:

 更新替代品--install的/ usr / bin中/海湾GCC /usr/bin/gcc-4.7 20
更新替代品--install的/ usr / bin中/ g ++的G ++ /usr/bin/g++-4.7 20
根@投标人:〜#更新替代品--config GCC
根@投标人:〜#更新替代品--config G ++

确认版本,并默认值:

 根@投标人:〜#的apt-缓存策略GCC

大多是从<引用href=\"http://askubuntu.com/questions/26498/choose-gcc-and-g-version/26518#26518\">http://askubuntu.com/questions/26498/choose-gcc-and-g-version/26518#26518在Ubuntu 12.04和个人经验。

I am trying to compile some libraries using gcc 4.7 (which i just upgraded from 4.6.3, somehow it complain about c compiler:

/home/rtbkit/platform-deps/node/wscript:263: error: could not configure a c compiler!
make[1]: Entering directory `/home/rtbkit/platform-deps/node'
Project not configured (run 'waf configure' first)
make[1]: *** [program] Error 1
make[1]: Target `all' not remade because of errors.
make[1]: Leaving directory `/home/rtbkit/platform-deps/node'
make[1]: Entering directory `/home/rtbkit/platform-deps/node'
Project not configured (run 'waf configure' first)
make[1]: *** [program] Error 1
make[1]: Target `all' not remade because of errors.
make[1]: Leaving directory `/home/rtbkit/platform-deps/node'
make[1]: Entering directory `/home/rtbkit/platform-deps/node'
Project not configured (run 'waf configure' first)
make[1]: *** [program] Error 1
make[1]: Leaving directory `/home/rtbkit/platform-deps/node'

installing
make[1]: Entering directory `/home/rtbkit/platform-deps/node'
Project not configured (run 'waf configure' first)
make[1]: *** [install] Error 1
make[1]: Leaving directory `/home/rtbkit/platform-deps/node'
cp: target `/home/rtbkit/local/include/node' is not a directory
make: *** [install_node] Error 1

解决方案

gcc-4.7 may not be set as the auto default. Depending on your OS version you may need to get the 4.7 version from another archive like PPA. This is for Ubuntu:

Install the python tools for adding an archive to apt-get:

root@bidder:~# apt-get install python-software-properties

Then add the ppa archive:

root@bidder:~# add-apt-repository ppa:ubuntu-toolchain-r/test

Make sure there are no existing linking:

root@bidder:~# update-alternatives --remove-all gcc
root@bidder:~# update-alternatives --remove-all g++

Update list of packages from all archives:

root@bidder:~# apt-get update

Install the 4.7 versions of gcc and g++ :

root@bidder:~# apt-get install gcc-4.7
root@bidder:~# apt-get -f install
root@bidder:~# apt-get install g++-4.7

Add default links to the new versions:

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
root@bidder:~# update-alternatives --config gcc
root@bidder:~# update-alternatives --config g++

Confirm the versions and defaults:

root@bidder:~# apt-cache policy gcc

Mostly referenced from http://askubuntu.com/questions/26498/choose-gcc-and-g-version/26518#26518 and personal experience on Ubuntu 12.04.

这篇关于无法配置C编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆