Rahul Singh Asked: 2015-07-21 09:54:54 +0800 CST2015-07-21 09:54:54 +0800 CST 2015-07-21 09:54:54 +0800 CST 无法获取 gcc 版本 772 我gcc的工作正常,因为我已经编译并运行了 hello world 代码并且它成功运行了。但是我看不到我的gcc版本。即使在使用gcc-v. 那么它安装正确了吗? 15.04 1 个回答 Voted Best Answer A.B. 2015-07-21T10:06:59+08:002015-07-21T10:06:59+08:00 除了你忘记了一个空间的事实: gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --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.9.2 (Ubuntu 4.9.2-10ubuntu13) 还有另一种选择: apt-cache policy gcc gcc: Installed: 4:4.9.2-2ubuntu2 Candidate: 4:4.9.2-2ubuntu2 Version table: *** 4:4.9.2-2ubuntu2 0 500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages 100 /var/lib/dpkg/status
除了你忘记了一个空间的事实:
gcc -v
还有另一种选择:
apt-cache policy gcc