from: http://omtlab.com/configure-your-eclipse-for-c/

Configure your eclipse for C++

July 7, 2013

This is small sample of how to use eclipse for c++.

There are two ways to use eclipse for C++.

1) Download Eclipse CDT : It is separate eclipse only for C/C++.
2) Download C++ Plugin in you existing eclipse.

I recommend you to download separate Eclipse CDT.

Download from here : http://www.eclipse.org/cdt/

After downloading eclipse CDT you need to download C++ compiler.

I am using MinGW compiler with eclipse. There are some other compiler like : cygwin

You need to install MinGW compiler in your pc.
Download MinGW from here : http://www.mingw.org/

After installing MinGW you need to set environment variable (MINGW_HOME) in you pc.

Name of variable is MINGW_HOME and set MinGW install directory as a path (Example : C:\MinGW).

All are set and now you can open your eclipse CDT.

Create new C++ project.

Goto File > New > C++ Project.

Small popup will open. Enter below details in it.

1) Enter your project name.
2) Select Project Type : Hello World C++ Project.
3) Select Toolchains: MinGW GCC.

Click on Next,Next and Finish.

Now final step before build your hello world project.

Right Click on your project and click on Properties.

Goto Project > Properties > C/C++ Build > Settings > Tool Settings (Tab) > MinGW C++ Linker (Option) > Add Command (g++ -static-libgcc -static-libstdc++) (default command is only g++)

Right click on your project select Build Project option.

It will generate some output in console.

23:43:15 **** Rebuild of configuration Debug for project omtcppexample ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o “src\\omtcppexample.o” “..\\src\\omtcppexample.cpp”
g++ -static-libgcc -static-libstdc++ -o omtcppexample.exe “src\\omtcppexample.o”

23:43:17 Build Finished (took 1s.596ms)

Again Right Click on your project and Run as > Local C/C++ Application.

Output :
!!!Hello World!!!

转:Configure your eclipse for C++的更多相关文章

  1. 创建jira插件

    准备环境.安装SDK https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and- ...

  2. Jetty学习四:部署到Jetty

    转自:http://www.tuicool.com/articles/NrENjq Web应用的框架 标准Jetty发布版本能部署标准servlet Spec Web应用和Jetty内部Context ...

  3. Jetty:部署到Jetty

    Web应用的框架 标准Jetty公布版本号能部署标准servlet Spec Web应用和Jetty内部ContextHandler部署描写叙述符,或者两者的一个混合. Web应用是可部署的动态(se ...

  4. jetty服务器数据源配置JNDI-Oracle,MySQL,SQLServer,DB2等 (转)

    下载jetty 下载jetty服务器(8.1.0.RC2),解压到任意目录下 http://dist.codehaus.org/jetty/jetty-hightide-8.1.0/jetty-hig ...

  5. Tomcat启动分析(二)-自己编译Tomcat

    为了方便分析Tomcat源码,利用大家习惯的方式来进行Debug调试,那么如何将Tomcat源码导入到Eclipse呢,这就是本文的重点 1 准备 1.1 获取Tomcat源码 获取tomcat源码有 ...

  6. 国产深度学习框架mindspore-1.3.0 gpu版本无法进行源码编译

    官网地址: https://www.mindspore.cn/install 所有依赖环境 进行sudo make install 安装,最终报错: 错误记录信息: cat     /tmp/mind ...

  7. Android Studio在导入eclipse的项目时一直卡在gradle:Configure project

    学Java的时候用的是eclipse,写android代码的时候用了疯狂android讲义推荐的AS.在用AS的时候出了很多问题,比如我想从别人那里拷贝eclipse写的工程的时候就遇到了Gradle ...

  8. How to Configure Eclipse for Python --- 在eclipse中如何配置pydev

    From: http://www.rose-hulman.edu/class/csse/resources/Eclipse/eclipse-python-configuration.htm Pytho ...

  9. 在 Linux 中使用 Eclipse 和 Gnu Autotools 管理 C/C++ 项目

    在我该系列的之前的所有随笔中,都是采用 Linux 发行版自带的包管理工具(如 apt-get.yum 等)进行软件的安装和卸载,从来没有向大家展示使用源代码自行编译安装软件的方法.但是长期混迹于 U ...

随机推荐

  1. linux 压缩命令详解

    原文地址:http://www.2cto.com/os/201112/114982.html 编写shell脚本的时候经常需要解压缩到指定的文件夹,tar命令是最常用的 参考一下说明,其中注意-C的用 ...

  2. 几个有用的JSON工具

    好久没写博客了,这里都要长草了:) 这几天研究PLM360 REST API和Infraworks REST API,一天到晚和JSON打交道,发现这几个小工具非常好用,推荐给大家. 第0个,大名鼎鼎 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 -(Q36-Q39)

    Question 36 You are designing a SharePoint 2010 application. You need to design the application so t ...

  4. UIView中的坐标转换

    在使用 UITableViewCell 的frame属性获取origin得到的坐标是不变的. 也就是说如果UITableView初始化完毕后,每个cell的坐标是固定的,x不变,y 随index递增的 ...

  5. Android的消息循环机制 Looper Handler类分析

    Android的消息循环机制 Looper Handler类分析 Looper类说明   Looper 类用来为一个线程跑一个消息循环. 线程在默认情况下是没有消息循环与之关联的,Thread类在ru ...

  6. 图形学理论知识 BRDF 双向反射分布函数(Bidirectional Reflectance Distribution Function)

    图形学理论知识 BRDF 双向反射分布函数 Bidirectional Reflectance Distribution Function BRDF理论 BRDF表示的是双向反射分布函数(Bidire ...

  7. C语言的基本输入与输出函数(全解)

    C语言的基本输入与输出函数 1.1.1 格式化输入输出函数 Turbo C2.0 标准库提供了两个控制台格式化输入. 输出函数printf() 和scanf(), 这两个函数可以在标准输入输出设备上以 ...

  8. 普通View的measure流程

    对于普通的view,其测量在ViewGroup中的measureChildWithMargins函数中调用child view的measure开始测量. 1:从measure函数开始 public f ...

  9. 重启 IIS7 应用程序池的批处理

    批处理很简单:c:\windows\system32\inetsrv\AppCmd.exe stop apppool /apppool.name:"ASP.NET v4.0"c:\ ...

  10. Java集合的10个最常见问题

    以下是一些在Stackoverflow上经常被问起的与Java集合相关的问题.在你查阅这些问题之前,最好先去看看[Simple Java]Java集合框架的接口和类层次关系结构图. 什么时候优先选择L ...