<div class="htmledit\_views" id="content\_views"> <p>一、下载教程</p> <p>1.在浏览器上搜索CodeBlocks官网或者直接输入网址<a href="http://www.codeblocks.org/" rel="nofollow">http://www.codeblocks.org/ 进入CodeBlocks官网</a>。</p> <p><img alt="" class="has" height="261" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215124542-1804813680.png" width="554"></p> <p>2.进入下载页面Downloads,一般都会选择第一个Download the binary release(二进制版本)</p> <p><img alt="" class="has" height="262" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215140561-209343412.png" width="554"></p> <p>3.进入之后,就会出来很多版本,我们要选择一个合适的版本,一般都会下载自带编译器的版本,这里到后面安装的时候会一个小问题,我在安装的时候再说。</p> <p><img alt="" class="has" height="263" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215157641-1478044306.png" width="554"></p> <p>4.点击之后可以直接点击direct link下载,或者点击mirror手动选择下载地址。</p> <p><img alt="" class="has" height="310" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215213268-140636037.png" width="554"></p> <p><img alt="" class="has" height="322" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215227174-294512298.png" width="554"></p> <p>二、安装教程</p> <p>1.下载完成后启动安装程序</p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215244648-2060727179.png" width="554"></p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215304821-1311424256.png" width="554"></p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215320791-1582978688.png" width="554"></p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215336834-322538748.png" width="554"></p> <p>2.注意:这里会有一个问题,如果这里你像我一样改变了默认安装地址,将安装地址选到了E盘,之后</p> <p>安装完成后需要改一下编译器位置。后面我会具体指出。</p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215353692-726808427.png" width="554"></p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215408554-878338560.png" width="554"></p> <p>3.根据需要看看是否要立即运行。</p> <p><img alt="" class="has" height="431" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215423539-329879902.png" width="554"></p> <p>4.安装完成。</p> <p>三、接下来就是编译器问题了</p> <p>1.打开CodeBlocks,如果有问题的的话,在右下角会出现一个问题,如图:</p> <p><img alt="" class="has" height="294" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215437905-838612479.png" width="554"></p> <p>此时CodeBlocks是不能运行代码的,原因是由于前面我们安装时改变了安装目录,而程序去默认的目录</p> <p>找这个文件夹没有找到就无法编译。这个问题很容易解决。选择程序目录setting->Compiler</p> <p>2.然后出现下图,按照图示点击,选择自己安装的位置,找到MinGW文件夹,点击确定。</p> <p><img alt="" class="has" height="528" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215452431-358410449.png" width="554"></p> <p>3.最后点击OK,这样就完成了。程序就可以编译运行了。</p> <p>四、CodeBlocks的使用</p> <p>1.打开软件,点击创建一个新的项目</p> <p><img alt="" class="has" height="294" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215507987-1886440388.png" width="554"></p> <p>2.点击Console application;</p> <p> <img alt="" class="has" height="346" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215522143-58722869.png" width="554"></p> <p>3.</p> <p><img alt="" class="has" height="466" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215537442-1618279405.png" width="554"></p> <p>4.创建一个文件名,如下图:</p> <p><img alt="" class="has" height="466" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215551514-1659734671.png" width="554"></p> <p>5.完成创建</p> <p><img alt="" class="has" height="294" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215614829-108789888.png" width="554"></p> <p>6.点击F9或者如下图,运行程序</p> <p><img alt="" class="has" height="139" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215631396-1714319863.png" width="554"></p> <p>7.OK,完成了!!!!</p> <p><img alt="" class="has" height="294" src="https://img2018.cnblogs.com/blog/1112483/201912/1112483-20191226215643999-1921186409.png" width="554"></p> <p> </p> <p>原文地址:https://blog.csdn.net/ysz171360154/article/details/84572114</p> </div>