mac eclipse EDT C++以及symbol 'std' could not be resolved问题的解决
来源:互联网 发布:查理.普斯 知乎 编辑:程序博客网 时间:2024/05/21 09:11
环境配置
测试文件test.cpp
#include <iostream>using namespace std;int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! return 0;}
1.安装c++编译环境,确保在命令行下输入g++ test.cpp 能正确生成二进制文件
i. 安装xcode, 在appstore可以下到。此时g++可以用,但是iostream,stdio.h等文件统统没有,因为相关命令行工具没有安装完成(坑爹!!)!
ii. 安装完整的g++命令行工具
Xcode->open developer tool-> More developer tools…
此时会跳转到apple网站上,下载最新版本的Command Line Tools(OS X XXXXX) for Xcode, 安装
OS X的名称,在苹果->about this mac上可以查到os的版本号,然后根据版本号去google它叫什么名字,俺们10.9.3叫Mavericks)
安装完成后,/usr/include下将出现各种熟悉的头文件如stdio.h以及一个目录c++
此时命令行执行g++ test.cpp, 所有报错消失,终于可以成功编过了。
2. 安装eclipse,官网下载
3.安装cdt:
在eclipse ->Help->Install New Softerware.
在最上的url中输入cdt的下载url,http://download.eclipse.org/tools/cdt/releases/juno,
出现CDT Main Features和CDT Optional Features,点开,选定自己需要安装的项,安装
重启eclips,在File ->New->下出现C/C++ Project, CDT安装完成。
4.设置CDT
在eclipse下,Project->Properties->C/C++ General->Paths and Symbols
GNU C 设为/usr/include
GNU C++ 设为/usr/include/c++/版本号
5重启eclips,新建一个c++工程,加入以上测试文件,build,run,大功告成!
symbol ‘std’ could not be resolved问题的解决
include中所有文件是程序编译时候去找头文件的所有地方。
添加方式:
右键点击demo4选最下面的properties:
将会出现如下图:
Preferences-> C/C++- > Build >Environment
点击 add,创建两个变量:
- Name: C_INCLUDE_PATH
Value: /usr/include Name: CPLUS_INCLUDE_PATH
Value: /usr/include/c++
(确定你的C++ 文件地址:
在终端,cd /usr/include
ls如果看到有c++文件,说明位置是正确的,否则,从\lib\gcc\i686-pc-cygwin\X.X.X\include中拷贝进去,然后重启eclipse。
最后,右键点击你的project,
Properties -> C/C++ General -> Paths and Symbols -> Includes -> Languages
看CNU C++以及GUN C对应右边的文件里面应该有/usr/include/c++和/usr/include了。
如下图:
说明设置成功。
但这时候如果发现symbol问题还存在,那么,右键点击你的文件,—>clean project—–>build project(这时候你的project中会出现Binaries)
symbol文件这时候也会消失
然后—- >index——>rebuild
然后—->run as
即可
- mac eclipse EDT C++以及symbol 'std' could not be resolved问题的解决
- 解决Eclipse中C++代码显示Symbol 'std' could not be resolved的问题
- linux eclipse 下 Symbol 'std’could not be resolved 问题的解决
- 解决Eclipse中C++代码显示Symbol 'std' could not be resolved的问题
- Eclipse编写C++出现Symbol 'std' could not be resolved错误提示的解决方案
- Eclipse CDT: Symbol 'cout' could not be resolved 解决
- Eclipse: symbol '???' could not be resolved [duplicate]
- Eclipse编写C++出现Symbol 'std' could not be resolved错误提示
- 【已解决】NDK下Eclipse中交叉编译C项目出错:Symbol ‘NULL’ could not be resolved(JNI)
- adt-bundle-mac Symbol 'vector' could not be resolved 处理
- 解决Eclipse交叉编译环境下出现Symbol"NULL" could not be resolved
- eclipse cdt indigo: symbol could not be resolved fixed
- win7+eclipse+CDT+cygwin symbol could not be resolved
- Eclipse错误提示: Symbol 'xxxx' could not be resolved
- eclipse出现Symbol could not be resolved解决方案
- eclipse : Type Symbol 'xxx' could not be resolved 解决办法
- eclipse CDT cygwin下出现大量Symbol could not be resolved的解决方法
- Symbol 'ANDROID_LOG_DEBUG' could not be resolved
- 20161229:for python网络数据采集03
- bootstrap html页面禁止放大缩小
- iOS开发日志输出第三方库
- proguard打包异常
- Java语言基础
- mac eclipse EDT C++以及symbol 'std' could not be resolved问题的解决
- 看看腾讯和百度等这样的大型网站系统架构是如何演化的
- CocoaPods创建自己的pod
- ubuntu14.04下设置静态IP
- nginx 代理http转https
- WiFi Throughput summary
- TCP服务器端、客户端模式初文
- 技术博客园系统开发设计总结
- php的强制转换