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. Android Studio常用快捷键

    Ctrl+U :如果你的光标在重写父类的一个方法内(如:Activity#onCreate()),这个将会跳到父类的实现上. 如果你的光标在类名上,它将会跳到父类. Ctrl+Alt+Home:它可以 ...

  2. umeng 渠道统计 android

    1.配置AndroidManifest.xml,添加权限 <uses-permission android:name="android.permission.ACCESS_NETWOR ...

  3. ParagraphString - 段落样式的简易处理

    ParagraphString - 段落样式的简易处理 效果 源码 https://github.com/YouXianMing/UI-Component-Collection 中的 Paragrap ...

  4. Textview在Listview中实现跑马灯效果

    textview添加属性:   android:singleLine="true" 表示单行显示   android:ellipsize="marquee" 设 ...

  5. Android App 开发技能图谱

    操作系统 Windows/MacOSX/Linux 编程语言 Java HTML/JS (Hybrid/Web App) C/C++ (NDK) SQL (DB) Kotlin 开发工具 IDE An ...

  6. C语言中的变量

    1. 计算机需要处理数据 2.数据需要保存在存储器上 3. 计算机只能识别0或者1的二进制数据 4.我们看到的,用到的所有数据在计算机中都是以二进制存储的 5.内存中的相同的01二进制数据,以不同的编 ...

  7. spring + spring mvc + mybatis + react + reflux + webpack Web工程例子

    前言 最近写了个Java Web工程demo,使用maven构建: 后端使用spring + spring mvc + mybatis: 前端使用react + react-router+ webpa ...

  8. Storm系列(三):创建Maven项目打包提交wordcount到Storm集群

    在上一篇博客中,我们通过Storm.Net.Adapter创建了一个使用Csharp编写的Storm Topology - wordcount.本文将介绍如何编写Java端的程序以及如何发布到测试的S ...

  9. HBase应用开发回顾与总结系列之二:RowKey行键设计规范

    2. RowKey行键设计规范 2.1. RowKey四大特性 2.1.1 字符串类型 虽然行键在HBase中是以byte[]字节数组的形式存储的,但是建议在系统开发过程中将其数据类型设置为Strin ...

  10. Swift完整项目打包Framework,嵌入OC项目使用

    场景说明: -之前做的App,使用Swift框架语言,混合编程,内涵少部分OC代码. -需要App整体功能打包成静态库,完整移植到另一个App使用,该App使用OC. -所以涉及到一个语言互转的处理, ...