window cygwin c環(huán)境搭建

https://cygwin.com/install.html
下載32 或者64位
下載cygwin饺蚊,在選擇從internet下載的時(shí)候建議添加鏡像站衷咽,提高下載速度
http://mirrors.163.com/.help/cygwin.html
選擇從互聯(lián)網(wǎng)安裝, 在"User URL"處輸入以下地址
http://mirrors.163.com/cygwin/
在搜索輸入框搜索下面的東西然后點(diǎn)擊Skip就會(huì)變成一個(gè)版本號(hào), 而右邊有一個(gè)bin,出現(xiàn)了一個(gè)x,再點(diǎn)擊可能會(huì)出現(xiàn)版本號(hào)變化谁撼,甚至 New的字段會(huì)出現(xiàn)src源代碼也勾選歧胁,然后最后又變成了skip,也就是不下載,按照國(guó)際慣例教程,都是選擇帶gun字樣的進(jìn)行安裝喊巍,
搜索的時(shí)候View選擇full屠缭,

gcc, gcc-core, gcc-g++, gcc-mingw-core, gcc-mingw-g++, make , gdb, binutils
我就下載了gcc-core,gcc-g++, make ,gdb
如果在eclipse跑起來(lái)出現(xiàn)了一個(gè)問(wèn)題也就是cygwin提示的問(wèn)題的話(huà)說(shuō)明沒(méi)有安裝好,我剛開(kāi)始的時(shí)候以為搜索需要按回車(chē)鍵結(jié)果直接就下載某些東西了崭参,導(dǎo)致一直報(bào)錯(cuò)呵曹,后面我把cygwin目錄刪除了重新裝了一遍才好。
然后在eclipse點(diǎn)擊錘子就可以進(jìn)行編譯了何暮,然后點(diǎn)擊源文件->運(yùn)行就可以看到控制臺(tái)輸出了.
下一步就會(huì)進(jìn)行下載
最后就完成安裝了奄喂,
當(dāng)下次還需要安裝的時(shí)候可以重新打開(kāi)安裝包,默認(rèn)將識(shí)別上次的配置郭卫。
配置環(huán)境變量
類(lèi)似這樣的路徑
F:\cygwin64\bin;
然后控制臺(tái)輸入make -version
出現(xiàn)了下面的類(lèi)似就是代表make成功了 輸入gcc --version如果能看到版本號(hào)也說(shuō)明gcc也成功下載了

C:\Users\Administrator>make -version
GNU Make 4.2.1
Built for x86_64-unknown-cygwin
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
C:\Users\Administrator>gcc --version
gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

下面是點(diǎn)擊完成輸出的一些東西砍聊。

binutils    (2.25-4)
    GNU assembler, linker, and similar utilities
    Required by: gcc-core, python, python2

bzip2   (1.0.6-3)
    BZip file de/compressor
    Required by: tar

ca-certificates (2.14-1)
    CA root certificates
    Required by: libopenssl100

cygwin-devel    (2.8.2-1)
    Core development files
    Required by: gcc-core, python

groff   (1.22.3-1)
    GNU roff formatter
    Required by: man-db

less    (487-1)
    A file pager program, similar to more(1)
    Required by: man-db

libargp (20110921-3)
    Interface for parsing command-line arguments
    Required by: getent

libatomic1  (5.4.0-1)
    GCC C11/C++11 locked atomics runtime library
    Required by: gcc-core

libattr1    (2.4.46-1)
    Shared lib for managing filesystem extended attributes
    Required by: coreutils

libblkid1   (2.25.2-2)
    Block device ID library (runtime)
    Required by: util-linux

libbz2_1    (1.0.6-3)
    BZip file de/compressor
    Required by: python, bzip2, python2

libcrypt0   (1.4-1)
    Encryption/Decryption utility and library
    Required by: python, libguile17, libguile2.0_22, python2

libdb5.3    (5.3.28-1)
    Oracle Berkeley DB (runtime)
    Required by: python, python2

libexpat1   (2.2.3-1)
    Expat XML parser library (shared library)
    Required by: gdb, python, python2

libffi6 (3.2.1-2)
    Portable foreign function interface library
    Required by: python, libguile2.0_22, python2, libp11-kit0

libgc1  (7.6.0-1)
    Boehm-Demers-Weiser garbage collector library
    Required by: libguile2.0_22

libgcc1 (5.4.0-1)
    GCC C runtime library
    Required by: gcc-core, libmpfr4, libgomp1, libquadmath0, libstdc++6, libncursesw10, libguile2.0_22, groff, libuuid1, libdb5.3, libgc1, libunistring2

libgdbm4    (1.12-1)
    GNU dbm implementation
    Required by: man-db, python, python2

libgmp10    (6.1.2-1)
    Library for arbitrary precision arithmetic (C runtime)
    Required by: coreutils, gawk, gcc-core, gcc-g++, libmpfr4, libisl13, libmpc3, libguile17, libguile2.0_22

libgomp1    (5.4.0-1)
    GCC OpenMP runtime library
    Required by: gcc-core

libguile17  (1.8.8-3)
    GNU Scheme interpreter library
    Required by: make

libguile2.0_22  (2.0.14-1)
    GNU Scheme interpreter library
    Required by: make

libiconv    (1.14-3)
    Unicode iconv() implementation
    Required by: man-db

libiconv2   (1.14-3)
    Unicode iconv() implementation
    Required by: alternatives, bash, coreutils, diffutils, gcc-core, gcc-g++, gdb, grep, info, man-db, tar, vim-minimal, libintl8, libpopt0, libguile2.0_22, groff, libiconv, libunistring2

libintl8    (0.19.8.1-2)
    GNU Internationalization runtime library
    Required by: alternatives, bash, coreutils, diffutils, findutils, gawk, gcc-core, gcc-g++, gdb, grep, info, make, man-db, sed, tar, util-linux, libattr1, libpopt0, binutils, python, libguile17, libguile2.0_22, libgdbm4, libiconv, xz, libblkid1, libsmartcols1, libuuid1, python2, libp11-kit0

libisl13    (0.14.1-1)
    Integer Set Library (runtime)
    Required by: gcc-core, gcc-g++

libltdl7    (2.4.6-4)
    Libtool dynamic library loader library (runtime)
    Required by: libguile17, libguile2.0_22

liblzma5    (5.2.3-1)
    LZMA de/compressor library (runtime)
    Required by: gdb, xz

libmpc3 (1.0.3-1)
    C library for multiple-precision floating-point computations with exact rounding (runtime)
    Required by: gcc-core, gcc-g++

libmpfr4    (3.1.5-1p10)
    A library for multiple-precision floating-point arithmetic with exact rounding (runtime)
    Required by: gawk, gcc-core, gcc-g++, libmpc3

libncursesw10   (6.0-11.20170617)
    Terminal display library
    Required by: gdb, info, libreadline7, ncurses, util-linux, vim-minimal, python, less, python2

libp11-kit0 (0.23.5-1)
    PKCS#11 module library
    Required by: p11-kit, p11-kit-trust

libpcre1    (8.40-3)
    Perl Compatible Regular Expressions UTF-8 runtime
    Required by: grep

libpipeline1    (1.4.0-1)
    C library for manipulating pipelines of subprocesses - runtime
    Required by: man-db

libpopt-common  (1.16-2)
    Command-line option parser library
    Required by: libpopt0

libpopt0    (1.16-2)
    Command-line option parser library
    Required by: cygutils

libquadmath0    (5.4.0-1)
    GCC Quad-Precision Math runtime library
    Required by: gcc-core

libsigsegv2 (2.10-2)
    Library for handling page faults in user mode (runtime)
    Required by: diffutils

libsmartcols1   (2.25.2-2)
    Tabular data formatting library (runtime)
    Required by: util-linux

libsqlite3_0    (3.19.3-1)
    An embeddable SQL database engine (library)
    Required by: python, python2

libssp0 (5.4.0-1)
    GCC Stack-Smashing Protection runtime library
    Required by: gcc-core, vim-minimal

libstdc++6  (5.4.0-1)
    GCC C++ runtime library
    Required by: gcc-g++, libncursesw10, groff, libdb5.3, libgc1

libtasn1_6  (4.12-1)
    ASN.1 library
    Required by: p11-kit, p11-kit-trust

libunistring2   (0.9.6-1)
    Library for manipulating Unicode strings - runtime
    Required by: libguile2.0_22

libuuid-devel   (2.25.2-2)
    Universally Unique ID library (development)
    Required by: python, python2

libuuid1    (2.25.2-2)
    Universally Unique ID library (runtime)
    Required by: util-linux, libblkid1, libuuid-devel

libvtv0 (5.4.0-1)
    GCC vtable verification library
    Required by: gcc-core

p11-kit (0.23.5-1)
    PKCS#11 module tool
    Required by: ca-certificates

p11-kit-trust   (0.23.5-1)
    PKCS#11 module library
    Required by: ca-certificates

python  (2.7.13-1)
    Obsoleted by python2
    Required by: gdb

python2 (2.7.13-1)
    Python 2 language interpreter
    Required by: python

tzcode  (2016j-1)
    Time Zone Database utilities
    Required by: coreutils

w32api-headers  (5.0.2-1)
    MinGW-w64 Windows API headers for Cygwin
    Required by: gcc-core, w32api-runtime

w32api-runtime  (5.0.2-1)
    MinGW-w64 Windows API import libraries for Cygwin
    Required by: gcc-core

windows-default-manifest    (6.4-1)
    Default Windows application manifest
    Required by: gcc-core

xz  (5.2.3-1)
    LZMA de/compressor
    Required by: tar

zlib0   (1.2.11-1)
    gzip de/compression library (runtime)
    Required by: file, gcc-core, gcc-g++, libopenssl100, man-db, util-linux, binutils, python, python2


用eclipse開(kāi)發(fā) c

http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/keplersr2
下載和電腦java 32或者64,一定要一樣贰军,不然會(huì)打開(kāi)出現(xiàn)找不到j(luò)ni xx .dll
新建C/C++項(xiàng)目
在Executable選項(xiàng)卡中可以看到右邊 分別列出來(lái)了識(shí)別到的c編譯器
Cross GCC Cygwin GCC Microsoft Visual C++
如果沒(méi)有Cygwin說(shuō)明環(huán)境變量的配置是有問(wèn)題的.

如果還需要帶java的話(huà)玻蝌。。
http://www.eclipse.org/downloads/eclipse-packages/
下載java的se,然后再下載cdt插件词疼。
http://www.eclipse.org/cdt/
http://www.eclipse.org/cdt/downloads.php
https://jingyan.baidu.com/article/456c463b67b4310a59314468.html
c代碼hello world

#include <iostream>
using namespace std;

int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

我的做法是新建C++ Project ->Executable -Hello World C++ Project -ToolChains選擇Cygwin GCC
點(diǎn)擊Next會(huì)自動(dòng)配置Source目錄俯树。
不然的話(huà)比較亂的,沒(méi)有source目錄的話(huà)贰盗。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末许饿,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子舵盈,更是在濱河造成了極大的恐慌陋率,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,126評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件秽晚,死亡現(xiàn)場(chǎng)離奇詭異瓦糟,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)赴蝇,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門(mén)菩浙,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人句伶,你說(shuō)我怎么就攤上這事劲蜻。” “怎么了考余?”我有些...
    開(kāi)封第一講書(shū)人閱讀 152,445評(píng)論 0 341
  • 文/不壞的土叔 我叫張陵先嬉,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我秃殉,道長(zhǎng)坝初,這世上最難降的妖魔是什么浸剩? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 55,185評(píng)論 1 278
  • 正文 為了忘掉前任钾军,我火速辦了婚禮鳄袍,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘吏恭。我一直安慰自己拗小,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,178評(píng)論 5 371
  • 文/花漫 我一把揭開(kāi)白布樱哼。 她就那樣靜靜地躺著哀九,像睡著了一般。 火紅的嫁衣襯著肌膚如雪搅幅。 梳的紋絲不亂的頭發(fā)上阅束,一...
    開(kāi)封第一講書(shū)人閱讀 48,970評(píng)論 1 284
  • 那天,我揣著相機(jī)與錄音茄唐,去河邊找鬼息裸。 笑死,一個(gè)胖子當(dāng)著我的面吹牛沪编,可吹牛的內(nèi)容都是我干的呼盆。 我是一名探鬼主播,決...
    沈念sama閱讀 38,276評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼蚁廓,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼访圃!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起相嵌,我...
    開(kāi)封第一講書(shū)人閱讀 36,927評(píng)論 0 259
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤腿时,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后饭宾,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體批糟,經(jīng)...
    沈念sama閱讀 43,400評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,883評(píng)論 2 323
  • 正文 我和宋清朗相戀三年捏雌,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了跃赚。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 37,997評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡性湿,死狀恐怖纬傲,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情肤频,我是刑警寧澤叹括,帶...
    沈念sama閱讀 33,646評(píng)論 4 322
  • 正文 年R本政府宣布,位于F島的核電站宵荒,受9級(jí)特大地震影響汁雷,放射性物質(zhì)發(fā)生泄漏净嘀。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,213評(píng)論 3 307
  • 文/蒙蒙 一侠讯、第九天 我趴在偏房一處隱蔽的房頂上張望挖藏。 院中可真熱鬧,春花似錦厢漩、人聲如沸膜眠。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,204評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)宵膨。三九已至,卻和暖如春炸宵,著一層夾襖步出監(jiān)牢的瞬間辟躏,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,423評(píng)論 1 260
  • 我被黑心中介騙來(lái)泰國(guó)打工土全, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留捎琐,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 45,423評(píng)論 2 352
  • 正文 我出身青樓涯曲,卻偏偏與公主長(zhǎng)得像野哭,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子幻件,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,722評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容