Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
185 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 https://askubuntu.com/questions/26498/choose-gcc-and-g-version/26518#26518 and personal experience on Ubuntu 12.04.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...