eclipse c++11 环境搭建

参考网上的帖子,使用 eclipse nano+gcc 5.3.0+Mingw5.3.0进行了开发环境的搭建,编写简单代码发现如下两个问题:

(1) undefined reference to `WinMain@16  链接时报这个错,具体原因是main函数放在 其中的某个namespace内,main函数需要 独立于各个空间。


(2)编译时总报找不到C++11的智能指针符号,原因 是没有正确配置工程将下面红色字体加入即可;

  • Make a new C++ project
  • Default options for everything
  • Once created, right-click the project and go to "Properties"
  • C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put -std=c++0x (or for newer compiler version -std=c++11 at the end . ... instead of GCC C++ Compiler I have also Cygwin compiler
  • C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste __GXX_EXPERIMENTAL_C++11__ (ensure to append and prepend two underscores) into "Name" and leave "Value" blank.
详见:https://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值