View Single Post
Old 07-18-11, 07:30 AM   #13
dk75
Registered User
 
Join Date: Jan 2009
Posts: 171
Default Re: Could not compile 'gcc-version-check.c' in my Debian box.

Strange thought... you are using stable debian (2.6.32 kernel) and have same problem like testing had (i have not anymore).

PS: i'm using alternatives system to change gcc, g++, gcov and cpp in one go to version that i need (all of them).
It needs to be configured before, like with that script (it's my environment script as i have 4.3, 4.4, 4.5 and 4.6 GCC installed):
Code:
#!/bin/bash

sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all gcov
sudo update-alternatives --remove-all cpp

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.3 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.3 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.3

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.4 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.4 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.4

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 45 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.5 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.5 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.5

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 46 \
	--slave /usr/bin/g++ g++ /usr/bin/g++-4.6 \
	--slave /usr/bin/gcov gcov /usr/bin/gcov-4.6 \
	--slave /usr/bin/cpp cpp /usr/bin/cpp-4.6

exit 0
Then i do "sudo update-alternatives --config gcc" and chose desired gcc environment.
__________________
  • Linux Debian Sid x86_64/ 3.2.0
  • Lenovo T61p
  • NVIDIA driver 295.33
  • Xorg/XServer 7.6+12/1.11.4
  • GNOME 3.2.2
dk75 is offline   Reply With Quote