How to using eclipse to develpe C/C++

I mainly discuss the use method of making files

 

When you created a c file, you will make the file in the next step. There are two ways。

 

1. Default

 

default method

 

2. Written by your self

 

made bu yourself 

 

 

Note: Never tick the "Same as target name"

 

3.You can do nothing.

 

right click your project, and then select property. In c/c++ Build, select Behavior, and tick "Build on resource save(Auto build)"

 

Finally, you should run the exe file in the file: Release/src/srchi

 

4.In a project, just a main() entry is allowed. Otherwise, you'll gain compiling error.

 

5. How to solve multiple main

http://weblog.imthewan.com/2010/09/eclipse-cdt-multiple-target/

 

1) 右击项目,点buildconfigurations create 一个Debug 如:array

2)右击项目中所有其他带main函数的文件,选exclude from build

3)点小锤子旁边的下拉按钮,选array

4)点小锤子可以只编译array.cpp

 

6. How to use make in eclipse cdt

Eclipse CDT 中使用 Make :http://ejb3.blogbus.com/logs/106960851.html 

 

7.利用j2ee实现多语言支持编程平台。

1)下载完后,先点check for updates(否则没有cdt等),再点install software,此时在available software sites能看到cdt site

2)点work with栏的下拉菜单,选中cdt,然后再一步步点下去。

 

8. unsolved iostream 等头文件

参考:http://hi.baidu.com/otss/blog/item/911cb762cb1fe6c8e6113a7a.html

真正解决办法:

启动eclipse后,经过 Windows-->Preferences-->C/C++-->Build-->Environment增加Environment variables to set

及点Add添加:

Name: C_INCLUDE_PATH

Value: /usr/include

Name: CPLUS_INCLUDE_PATH

Value: /usr/include/c++/4.5.1(这个取决个人的Gcc版本,先察看Gcc版本好,不会?那就man gcc)

就此,理论上应该好了,如果还没有好,尝试以下:

右键你的工程-->C/C++ Build-->Discovery Options-->(找到)Discovery profile: (选择)GCC per project scanner info profile

具体原因估计是传说中的Profile问题!仁者见仁了!

如果还不行,那我就没辙了!^_^

 

 9. ld问题
在indows-->Preferences-->C/C++-->Build-->Settings-》c++ linkers->Libraries 添加需要的库
collect2: ld 返回 1
这个问题,有一次没有实现头文件中定义的方法,抛出ld return 1的错误,还有整个project没有main时,也会有如下错误。被误导了大半天。

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值