安裝好一個基本的編譯器後怎麼辦
1. 大家初學c語言用的編輯器和編譯器是怎麼下載安裝詳細步驟
Vscode集成一下就好
2. 在虛擬機內安裝了gcc編譯器後,重新啟動了本機。在打開虛擬機,安裝的文件在次消失,就像安裝了還原卡。
虛擬機問題,重裝虛擬機,這是虛擬機沒有保存數據,或者你創建安裝系統的路徑下不可寫造成的
3. 如何安裝GCC編譯器和開發工具
在CentOS 7和RHEL 7系統上如何安裝Gnu GCC編譯器和相關的工具比如:autoconf,automake,flex, c++編譯器等工具。我們可以通過在centos 或者rhel 7 系統上安裝下面的軟體包來搭建基本的開發環境。
autoconf
automake
binutils
bison
flex
gcc
gcc-c++
gettext
libtool
make
patch
pkgconfig
redhat-rpm-config
rpm-build
rpm-sign
顯示當前系統的yum group,使用下面的命令:
yum group list
命令輸出:
[root@itsprite /]# yum group list
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* extras: mirrors.btte.net
* updates: mirrors.btte.net
Available environment groups:
Minimal Install
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
GNOME Desktop
KDE Plasma Workspaces
Development and Creative Workstation
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
安裝GCC和開發環境
輸入下面的命令:
yum group install "Development Tools"
安裝完之後,使用下面的命令來驗證gcc是否安裝成功:
whereis gcc
命令輸出:
[root@itsprite /]# whereis gcc
gcc:/usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
輸入下面的命令來查看gcc工具的版本:
[root@itsprite /]# gcc --version
gcc (GCC) 4.8.2 20140120(Red Hat 4.8.2-16)
Copyright (C)2013 Free Software Foundation, Inc.
This is free software; see the source for ing conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
測試GCC編譯器
下面我們使用剛安裝好的GCC編譯器來編譯一個c語言程序.
創建下面的test.c程序:
#include
int main(void){
printf("Hello World!\n");
return0;
}
輸入命令編譯test.c 文件:
gcc test.c -o test
執行編譯後的文件:
./test
Hello World!