解决Eclipse IDE for C_C++ 中的A program file was not specified in the launch configuration
- 格式:pdf
- 大小:342.48 KB
- 文档页数:6
[原创]XP下Eclipse + MinGW + Qt安装及问题解决方法本人由于工作原因开始接触在Eclipse开发环境下开发与Qt相关的C++项目,原本使用的Visual Stdio开发平台,后由于Eclipse通过插件组件构建开发环境方便快捷,就转到了Eclipse开发平台下,现将Windows XP下配置Eclipse 使之支持C++开发Qt相关项目中的步骤和遇到的问题及其解决方法做下总结,仅供大家学习探讨。
由于是使用Eclipse平台不久,遇到的问题大部分都是通过在网上查阅相关资料才得以解决,所以说本文也算是一个总结贴吧,在此对于网上提供帮助的朋友表示感谢。
1,下载Qt并安装。
到Qt的官方网站上(/downloads-cn)直接下载最新的qt版本qt-win-opensource-4.7.2-mingw.exe (选择右边的“Qt:仅下载框架->下载用于Windows的Qt库4.7.2(minGW4.4,321MB)”),安装即可。
此版本已经集成了编译环境minGw(注意:只是编译环境不包括IDE,Eclipse才是真正的IDE),在安装过程中选中minGW 安装即可。
如上图所示,在1中选择下载qt-win-opensource-4.7.2-mingw.exe,并在2中选择下载MinGW-gcc440_1.zip,这在下面安装Qt的过程中要用到。
在安装过程中遇到问题如下:但是在实际安装过程中还是需要手动配置minGW,因为qt-win-opensource-4.7.2-mingw.exe软件包需要MinGW,并且需要指定minGW的安装路径,也就是说在安装Qt时电脑上应该已经单独配置好MinGW了,在此只需要把MinGW的安装路径指定就可以实现和Qt的集成,安装Qt 过程中的需要指定MinGW如下图所示:这就需要第一步在选择下载最新的Qt版本时再顺便下载minGW的压缩包,实际上的安装顺序应该是先配置好MinGW再安装Qt(第一步先将MinGW-gcc440_1.zip下下来并解压到C盘根目录中),并在Qt安装过程中需要正确选择minGW的安装路径(C:\MinGW,如上图所示),进而Qt才能将MinGW集成到Qt中;如果在安装Qt的过程中事先没有配置MinGW,则需要事后手动安装,见下面步骤。
iAbout the T utorialEclipse is an integrated development environment (IDE) for Java and other programming languages like C, C++, PHP, and Ruby etc. Development environment provided by Eclipse includes the Eclipse Java development tools (JDT) for Java, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.This tutorial will teach you how to use Eclipse in your day-2-day life while developing any software project using Eclipse IDE. We will give special emphasis on Java project. AudienceThis tutorial has been prepared for beginners to help them understand basic functionality of Eclipse tool. After completing this tutorial, you will find yourself at a moderate level of expertise in using Eclipse IDE from where you can take yourself to next levels. PrerequisitesWe assume you are going to use Eclipse IDE to handle all levels of Java projects development. So it will be good if you have knowledge of software development using any programming language specially Java programming.Copyright & Disclaimer© Copyright 2015 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book can retain a copy for future reference but commercial use of this data is not allowed. Distribution or republishing any content or a part of the content of this e-book in any manner is also not allowed without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or inthistutorial,******************************************iT able of ContentsAbout the Tutorial (i)Audience (i)Prerequisites (i)Copyright & Disclaimer (i)Table of Contents .................................................................................................................................... i i 1.OVERVIEW (1)What is Eclipse? (1)Licensing (1)Eclipse Releases (1)2.INSTALLATION (3)Downloading Eclipse (3)Installing Eclipse (3)Launching Eclipse (4)3.EXPLORE WINDOWS (5)Parts of an Eclipse Window (5)Using Multiple Windows (6)4.EXPLORE MENUS (7)Typical Eclipse Menus (7)Brief Description of Menus (8)Customizing Menus (8)5.EXPLORE VIEWS (9)About Views (9)Organizing Views (9)Moving Views (9)Creating View Folders (10)Opening a view (10)6.PERSPECTIVES (13)What is a Perspective? (13)Opening a Perspective (13)Switching between Perspectives (13)Closing a Perspective (14)Customizing a Perspective (14)7.WORKSPACES (16)About Eclipse Workspace (16)UI Elements for Managing the Workspace (16)8.CREATE JAVA PROJECT (18)Opening the New Java Project wizard (18)Using the New Java Project wizard (18)Viewing the Newly Created Project (20)9.CREATE JAVA PACKAGE (21)Opening the New Java Package wizard (21)Using the New Java Package Wizard (21)Viewing the Newly Created Package (22)10.CREATE JAVA CLASS (23)Opening the New Java Class Wizard (23)Using the New Java Class Wizard (23)Viewing the Newly Created Java class (24)11.CREATE JAVA INTERFACE (25)Opening the New Java Interface Wizard (25)Using the New Java Interface Wizard (25)Viewing the Newly Created Java Interface (26)12.CREATE XML FILE (27)Opening the New XML File wizard (27)Using the New XML File wizard (28)Viewing the Newly Created XML File (29)13.JAVA BUILD PATH (30)Setting the Java Build Path (30)14.RUN CONFIGURATION (31)Creating and Using a Run Configuration (31)15.RUNNING A PROGRAM (33)Running a Java Program (33)16.CREATE JAR FILES (35)Opening the Jar File wizard (35)Using the Jar File wizard (35)17.CLOSE PROJECT (37)Why Close a Project? (37)How to Close a Project? (37)Closed Project in Package Explorer (38)18.REOPEN PROJECT (39)Reopening a Closed Project (39)19.BUILD PROJECT (40)Building a Java Project (40)20.DEBUG CONFIGURATION (42)Creating and Using a Debug Configuration (42)21.DEBUGGING A PROGRAM (44)Debugging a Java Program (44)22.PREFERENCES (48)Setting Preferences (48)23.CONTENT ASSIST (50)Using Content Assist (50)24.QUICK FIX (52)Using Quix Fix (52)25.HOVER HELP (54)Using Hover Help (54)26.SEARCH MENU (56)Searching the Workspace (56)27.NAVIGATION (58)Navigating the Eclipse Workspace (58)Open Type (58)Open Type in Hierarchy (60)Open Resource (61)28.REFACTORING (63)Refactoring using Eclipse (63)29.ADD BOOKMARKS (64)About Bookmarks (64)Adding a Bookmark (64)Opening the Bookmarks View (64)Using the Bookmarks View (65)30.TASK MANAGEMENT (66)Managing Tasks (66)Opening the Tasks View (67)Using the Tasks View (67)31.INSTALL PLUGINS (69)Locating and Installing Plug-ins (69)32.CODE TEMPLATES (73)Using Code Templates (73)Modifying/Adding code templates (74)33.SHORTCUTS (75)About Shortcuts (75)34.RESTART OPTION (78)Restarting Eclipse (78)35.TIPS & TRICKS (79)36.WEB BROWSERS (81)Internal Web Browser (81)Eclipse 7What is Eclipse?In the context of computing, Eclipse is an integrated development environment (IDE) for developing applications using the Java programming language and other programming languages such as C/C++, Python, PERL, Ruby etc.The Eclipse platform which provides the foundation for the Eclipse IDE is composed of plug-ins and is designed to be extensible using additional plug-ins. Developed using Java, the Eclipse platform can be used to develop rich client applications, integrated development environments, and other tools. Eclipse can be used as an IDE for any programming language for which a plug-in is available.The Java Development Tools (JDT) project provides a plug-in that allows Eclipse to be used as a Java IDE, PyDev is a plugin that allows Eclipse to be used as a Python IDE, C/C++ Development Tools (CDT) is a plug-in that allows Eclipse to be used for developing application using C/C++, the Eclipse Scala plug-in allows Eclipse to be used an IDE to develop Scala applications and PHPeclipse is a plug-in to eclipse that provides complete development tool for PHP.LicensingEclipse platform and other plug-ins from the Eclipse foundation is released under the Eclipse Public License (EPL). EPL ensures that Eclipse is free to download and install. It also allows Eclipse to be modified and distributed.Eclipse ReleasesEvery year, since 2006, the Eclipse foundation releases the Eclipse Platform and a number of other plug-ins in June.1.Eclipse8Eclipse 9Downloading EclipseYou can download eclipse from /downloads/. The download page lists a number of flavors of eclipse.The capabilities of each packaging of eclipse are different. Java developers typically use Eclipse Classic or Eclipse IDE for developing Java applications.The drop down box in the right corner of the download page allows you to set the operating system on which eclipse is to be installed. You can choose between Windows, Linux and Mac. Eclipse is packaged as a zip file.Installing EclipseTo install on windows, you need a tool that can extract the contents of a zip file. For example you can use:∙7-zip ∙PeaZip ∙ IZArcUsing any one of these tools, extract the contents of the eclipse zip file to any folder of your choice.2.Launching EclipseOn the windows platform, if you extracted the contents of the zip file to c:\, then you can start eclipse by using c:\eclipse\eclipse.exeWhen eclipse starts up for the first time it prompts you for the location of the workspace folder. All your data will be stored in the workspace folder. You can accept the default or choose a new location.1011If you select "Use this as the default and do not ask again", this dialog box will not come up again. You can change this preference using the Workspaces Preference Page. See the Preference tutorialpage for more details.Eclipse 12Parts of an Eclipse WindowThe major visible parts of an eclipse window are:∙Views ∙Editors (all appear in one editor area) ∙Menu Bar ∙ ToolbarAn eclipse perspective is the name given to an initial collection and arrangement of views and an editor area. The default perspective is called java. An eclipse window can have multiple perspectives open in it but only one perspective can be active at any point of time. A user can switch between open perspectives or open a new perspective. A perspective controls what appears in some menus and tool bars.3.EclipseA perspective has only one editor area in which multiple editors can be open. The editor area is usually surrounded by multiple views. In general, editors are used to edit the project data and views are used to view the project metadata. For example, the package explorer shows the java files in the project and the java editor is used to edit a java file.The eclipse window can contain multiple editors and views but only one of them is active at any given point of time. The title bar of the active editor or view looks different from all the others.The UI elements on the menu bar and tool bar represent commands that can be triggered by an end user.Using Multiple WindowsMultiple Eclipse Windows can be open at the same time. To open a new window, click on the Windows menu and select the New Window menu item.Each window can have a different perspective open in them. For example you could open two Eclipse windows one in the Java perspective and the other in the Debug perspective. The window showing the Java perspective can be used for editing the java code and the window showing the debug perspective can be used for debugging the application being developed.13Eclipse 14T ypical Eclipse MenusThe typical menus available on the menu bar of an Eclipse window are:∙File menu ∙Edit menu ∙Navigate menu ∙Search menu ∙Project menu ∙Run menu ∙Window menu ∙ Help menu4.Plug-ins can add new menus and menu items. For example when the java editor is open, you will see the Source menu and when the XML editor is open, you will see the Design menu. Brief Description of Menus15Customizing MenusThe visible menu items on a menu depend on the installed plug-ins and customization done using the Customize Perspective dialog box.16Eclipse 17About ViewsEclipse views allow users to see a graphical representation of project metadata. For example the project navigator view presents a graphical representation of the folders and files associated with a project and properties view presents a graphical representation of an element selected in another view or editor.An eclipse perspective can show any number of views and editors. All editor instances appear in a single editor area, whereas views are placed inside view folders. A workbench window can display any number of view folders. Each view folder can display one or more views. Organizing ViewsThe following picture shows four views arranged in a view folder.The picture given below shows the same four views arranged in two view folders.5.Moving ViewsTo move a view from one view folder to another, just click on the view title and drag to the title bar area of another view folder. The green line shown below is a result of dragging the title bar of the Properties view from one view folder to the title bar area of another view folder. The Properties view can be moved to where the green line is by releasing the mouse button and sending out a drop event.Creating View FoldersView folders can be dynamically created by dragging the title bar of a view to anywhere outside the editor area and title bar of another view folder. As you drag the title bar around, green lines will indicate where exactly the new view folder will be created.Moving the drag icon to the bottom of a window allows you to create a view folder that spans the entire width of the window. Moving the drag icon to the left or right edge of window allows you to create a view folder that spans the entire height of the window.18Opening a viewTo open a view, click on the Window menu and select the Show View menu item.19Clicking on the Other menu item brings up the Show View dialog box that allows you to locate and activate a view.20The views are organized by category. To quickly locate a view, just type the name of a view into the filter text box. To open a view, select it and click on the OK button. The subsequent pages of this tutorial introduce you to a number of useful views.21End of ebook previewIf you liked what you saw…Buy it from our store @ https://22。
idea编译c代码-回复编译C 代码编译C 代码是将高级编程语言C 转化为机器语言的过程,以便计算机能够执行代码,完成特定的任务。
在本文中,我们将探讨编译C 代码的步骤和原理,并提供一些实用的技巧和建议。
一、什么是编译?编译是将源代码(由程序员编写的文本文件)转化为机器代码的过程。
机器代码是由计算机硬件直接执行的二进制指令。
编译器负责将高级编程语言的源代码转化为机器代码,以便计算机能够理解和执行。
二、编译C 代码的步骤1. 预处理(Preprocessing)预处理是编译器的第一步,它处理以"#"开始的指令,如包含其他文件的指令(#include)、定义宏(#define)等。
预处理器将这些指令替换为实际的代码或文件,以便编译器在后续阶段能够正确地处理代码。
2. 编译(Compilation)编译是将预处理后的代码转化为汇编语言的过程。
汇编语言是一种更接近机器语言的低级编程语言,它将每一条高级语言的指令转化为机器语言的指令。
3. 汇编(Assembly)汇编是将汇编语言的代码转化为机器代码的过程。
汇编器将每一条汇编语言的指令翻译成计算机硬件能够执行的二进制码,即机器指令。
4. 链接(Linking)链接是将编译后的目标文件(包含机器代码)与其他目标文件或库文件合并成一个可执行文件的过程。
链接器负责解决函数和变量引用的问题,以确保代码能够正确地执行。
三、编译器的选用和调试技巧1. 编译器的选择在编译C 代码时,我们可以选择不同的编译器。
常见的C 编译器有GCC、Clang、Microsoft Visual C++ 等。
选择适合自己的编译器需要考虑因素包括操作系统的支持、编译速度、错误提示和调试功能等。
2. 调试技巧在编译C 代码时,可能会遇到错误和调试的情况。
以下是一些常用的调试技巧:- 使用调试器:调试器是一个强大的工具,可以帮助识别和解决代码中的问题。
调试器允许你逐行执行代码,并在执行过程中观察变量的值和程序流程。
EclipseforC++使用说明Eclipse(for C++)使用说明1、启动eclipse,在命令行中输入eclipse,出现窗口,如下图所示:2、添加工程在file菜单中选择import,出现窗口如下:3、在General下选择Existing Projects into Workspace,单击next,出现如下窗口:4、点击Browse,选择工程位置,出现下图所示5、单击Finish,工作区如下图所示:6、修改build选项,有两种方法方法一:在项目名称上单击右键,选择Properties方法二:选中项目,在菜单栏,选择Project/Properties出现下图:在左边选择C/C++ Build,修改Build directory:选择File system,选择makefile所在的文件夹,点击OK7、在菜单栏选择Project/Build All,整个项目开始编译,如下图所示:8、Run,在菜单栏选择Run/Run Configurations,出现窗口如下:选择Arguments,点击File System,然后选择可执行文件所在目录,点击Apply,Close然后在工具栏点击,程序即可运行9、Debug在Project explorer中,选择可执行文件,然后在菜单栏选择Run/Debug As,出现如下对话框,或者在工具栏点击图标,配置如下图:点击OK,会弹出如下窗口:选择Yes,整个工作区将切换到debug模式,如下图所示:10、切换工作区视图11、其他A、查看函数的定义,按下CTRL键后,将鼠标移动到函数名称上左键单击,即可跳转到函数的定义处。
B、如果想返回到上一视图,在工具栏点击C、将鼠标移动到函数定义处,然后按下F2键,即可在浮出的窗口中查看该函数的代码D、在左边Project explore中双击文件,即可在工作区中打开该文件进行编辑12、在Eclipse中使用CVS在项目名上单击鼠标右键,在弹出的菜单中选择Team,会出现相关选项。
关于eclipse环境启动不成功的问题解决⽅法常信息补充:Caused by: javassist.CannotCompileException: by ng.OutOfMemoryError: PermGen spaceat javassist.ClassPool.toClass(ClassPool.java:1099)at javassist.CtClass.toClass(CtClass.java:1265)at com.taobao.hsf.bytecode.ClassGenerator.toClass(ClassGenerator.java:293)... 37 moreCaused by: ng.OutOfMemoryError: PermGen spaceat ng.ClassLoader.defineClass1(Native Method)at ng.ClassLoader.defineClassCond(Unknown Source)at ng.ClassLoader.defineClass(Unknown Source)at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at ng.reflect.Method.invoke(Unknown Source)at javassist.ClassPool.toClass2(ClassPool.java:1112)at javassist.ClassPool.toClass(ClassPool.java:1093)at javassist.CtClass.toClass(CtClass.java:1265)在 VM arguments中添加配置:-Xms256m -Xmx512m -XX:PermSize=128M -XX:MaxNewSize=128m -XX:MaxPermSize=256m另外的博客之前使⽤tomcat7时遇到启动报错问题,⽇志如下:严重: ContainerBase.addChild: start:org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mypro]]at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at ng.Thread.run(Thread.java:619)Caused by: ng.IllegalStateException: Unable to complete the scan for annotations for web application [/mypro]. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependenciesat org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2109)at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1981)at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1947)at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1932)at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1326)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)... 11 moreCaused by: ng.StackOverflowErrorat java.util.HashMap.get(HashMap.java:300)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2257)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2269)……在⽹上找了很久,最终解决问题,在这时MARK⼀下。
MyEclipse 8.5 开发环境配置,汉化,Aptana2.0插件,SVN 插件,Flex Builder 3/4 插件安装url:/blog/630864下载MyEclipse 8.5可以通过代理/访问MyEclipse的官方网站下载软件下载地址:/downloads/products/eworkbench/galil eo/myeclipse-8.5.0-win32.exe文件大小: 825.84 MBMD5 : a9038148dcde9066abc3711bf8ee636c---------------------------------------------------环境说明:MyEclipse安装路径E:\MyEclipse\MyEclipse8.5Common安装路径E:\MyEclipse\Common新建一个E:\MyEclipse\myPlugin专放我们后加入的插件---------------------------------------------------MyEclipse Configuration Center 管理MyEclipse插件的一种手段参考:<Myeclipse8.5GA优化笔记> /blog/639767 dashboard—插件面板,可以添加和删除Myeclipse的插件software —自定义添加其他软件collaboration —可以分享你的配置信息和团队协作的支持subscription —注册信息,去下一篇文章里找的注册码可以贴在这里1:添加软件,可以是在线更新的URL,也可以是本地的文件夹.一般用下载工具把插件下载到本地,在这里添加一个本地的文件夹来安装插件.2:对前面添加的地址进行验证,从中找到插件. 在找到的插件上,右击鼠标,选"Add to Profile",插件被添加到"4"的位置3:可以对以添加的插件删除4:被添加的插件5:将要被添加的插件,6:执行添加动作MyEclipse Configuration Center不太好用,反应较慢,有时要关了再开才会达到效果,由其删除时.---------------------------------------------------汉化MyEclipse 8.5首先下载汉化包文件:/Files/sy1214520/Myeclipse8.5%20汉化.zip1、将解压后的―language‖文件夹中的features与plugins文件夹放入E:\MyEclipse\MyPlugin\language里面。
1.Android导入一个工程时提示Invalid project description的解决方法2.Unable to execute dex: java.nio.BufferOverflowException.解决办法1.Android导入一个工程时提示Invalid project description的解决方法网上搜了下说是:其实这是基于Eclipse IDE导入工程时遇到描述文件版本不对都会存在这种问题,而这个问题在Android开发中其实是由于android manifest.xml文件版本不同造成的。
具体的我对Eclipse不太熟悉,不过经过一番查询和试验我发现造成这样的错误的原因是:因为我把要导入的工程文件夹放到了Eclipse 的Android默认目录下,而当Eclipse导入工程时候,在默认目录下要创建新文件加(或者拷贝)。
这时,创建的文件夹名与被导入的文件夹名在同一目录下,而且重复,出现如此错误(以上原因是个人简单试验后臆测,没有可靠证据哈。
)。
所以,解决的办法就是,把将要导入的文件夹放到其他地方。
比如说我的Eclipse Android默认工作目录是E:/AndroidWorkspace;将要导入的工程文件夹是Hello。
如果我们把Hello直接放到E:/AndroidWorkspace目录下,再导入,就会出现上述错误!!我们改变下目录即可,比如放到E:/AndroidCode目录下!!2.Unable to execute dex: java.nio.BufferOverflowException.解决办法右键选择项目,选择Build Path——Configure Build Path...,然后在弹出框中选择:Java Build Path——Libraries,最后将Android Dependencies和Android Private Libraries移除(remove)掉即可。
eclipse安装cdt和mingw配置Eclipse除了可以开发Java之外,还支持了许多语言,现在先介绍C、C++的开发环境设定,以后有机会再介绍其它的。
Enjoy it!OS:Windows 7 Ultratimate一.首先要下载Eclipse IDE for C/C++ Developers,请下载这项:/downloads/安装:解压文件到指定目录下(自己的工作目录,如:D:\)二.下载可在Windows上使用的GNU C、C++编译器,这里要下载的是:MinGW。
下载网址:/projects/mingw/files/说明:该文件是在线安装文件,安装时需要选择安装的模块,除下述三项,其余均选。
安装:安装目录选C槽,然后狂点下一步(Next)就行了。
安装完后路径是这样->D:\Program Files\MinGW\。
三.先在Command Line模式下测试编译与执行。
先将D:\Program Files\MinGW\bin底下的mingw32-make.exe更名为make.exe,因为待会在Eclipse使用时它预设会抓系统里make 这个文件名而不是mingw32-make 。
(注:如果不更名或是还有其它make 程序时,也可以在稍后的Eclipse 设定中,在make targets view 的地方,新增一个task 时,build command 取消use default , 使用 mingw32-make ,或在project properties->make project ->将make 改为 mingw32-make ) -- 由 snpshu 补充。
点击“计算机”右键属性,高级系统设置->环境变量->系统变量加入下列设定:PATH : D:\Program Files\MinGW\bin; (如果系统已经有装其它C/C++编译器,请把D:\Program Files\MinGW\bin 加在最前面。
Eclipse+GNU ARM环境搭建说明文档介绍本文介绍了Eclipse+GNU ARM的编译、调试的环境搭建方法。
版本说明1.J-link程序及驱动安装1.1. 安装方式安装文件及补丁包位于“0. J-link驱动”文件夹下。
1、安装“Setup_JLinkARM_V440.exe”文件。
2、将“Segger.rar”文件解压,然后替换安装目录下的文件。
1.2. 安装验证1、安装完毕后,插上J-Link仿真器,在系统的“设备管理器”中可以看到:2、在系统开始菜单可以看到SEGGER程序组。
3、将仿真器通过USB线接入计算机,另一端接到目标板。
4、给目标板上电。
5、打开“J-Link Commander”命令,可以看到选择对应的USB口。
6、弹出CMD命令行后可以观察到J-Link状态:说明链接成功、设备正常。
以上,J-Link驱动及应用程序安装结束。
2.Eclipse IDE编译环境的安装2.1. 版本选择当前Eclipse版本:eclipse MARS.1(可以参考GNU ARM官网,选择配套的Eclipse)2.2. 安装方式安装文件及补丁包位于“1. Eclipse IDE for CC++ Developers”文件夹下。
1、根据本地计算机的位数,选择32位(eclipse-cpp-mars-1-win32.zip)或64位(eclipse-cpp-mars-1-win32-x86_64.zip)安装文件。
2、将压缩文件解压后的“eclipse”文件夹拷贝到自记选择的安装目录。
(鉴于Eclipse为绿色文件,安装目录最好不要选择系统盘C盘。
)(安装目录最好为目标分区的根目录。
某些Eclipse插件对空格敏感。
)2.3. 工作空间设置打开Eclipse后,选择工作目录,此目录为程序空间目录的上一级目录。
打开后如下图:3.CDT插件安装1、保证本地计算机可以上网。
2、打开Eclipse。
Eclipse编译C程序1. 简介Eclipse是一种功能强大的开发环境,主要用于Java开发,但也可以用于其他编程语言,包括C语言。
在本文中,我们将介绍如何使用Eclipse来编译C程序。
2. 准备工作在开始之前,确保您已经完成以下准备工作:•安装最新版本的Eclipse IDE。
•安装C/C++开发工具,例如CDT(C/C++ Development Tooling)插件。
•确保您已经安装了C编译器,例如GCC。
3. 创建C项目首先,让我们通过以下步骤在Eclipse中创建一个新的C项目:1.打开Eclipse IDE。
2.选择“File”菜单,然后选择“New”>“C Project”。
3.在弹出的对话框中,为项目命名,并选择“Executable”作为项目类型。
然后,单击“Next”。
4.在下一个对话框中,选择“Empty Project”并确保选择了正确的编译器。
然后,单击“Finish”完成项目创建。
现在,您已经成功创建了一个C项目。
4. 添加C文件接下来,我们将向项目中添加一个C文件:1.在项目资源管理器中,右键单击项目名称,然后选择“New”>“SourceFile”。
2.在弹出的对话框中,为C文件命名,并选择“C Source File”作为文件类型。
然后,单击“Finish”。
3.现在,您将在项目中看到一个新的C文件。
您可以在该文件中编写C代码。
5. 编写C代码在C文件中,您可以编写您的C代码。
例如,以下是一个简单的Hello World程序的示例:#include <stdio.h>int main() {printf("Hello, World!\n");return 0;}请注意,您可以在Eclipse中使用普通的C语法和标准库函数。
6. 编译C程序现在,让我们编译并运行C程序:1.单击Eclipse工具栏中的“Build”按钮,或使用快捷键Ctrl + B,以编译项目。