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

doesn't CC is symlinked to GCC at your system?
After that update-alternatives do symlinking to GCC desired gcc version
Code:
:~$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-1) 
:~$ 
:~$ sudo update-alternatives --config gcc
There are 4 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-4.6   46        auto mode
  1            /usr/bin/gcc-4.3   43        manual mode
  2            /usr/bin/gcc-4.4   44        manual mode
  3            /usr/bin/gcc-4.5   45        manual mode
  4            /usr/bin/gcc-4.6   46        manual mode

Press enter to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/gcc-4.3 to provide /usr/bin/gcc (gcc) in manual mode.
:~$ 
:~$ cc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.5-4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.5 (Debian 4.3.5-4) 
:~$
__________________
  • 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