Eclipse cdt解决github导入的项目无法打开声明的bug (cannot open declaration)
2014-10-04 23:09
946 查看
概述:
我利用eclipse 的git插件clone github上的远程项目(C++)到本地时遇到一个问题:clone下来的项目没有C++特性,无法使用open declaration等操作,下面是解决这个问题的办法。问题:
在eclipse cdt中import github的远程项目,操作是import ->Git/projects from git ->Clone URI
导入的项目可以switch branch, 但就是不能打开函数的声明,实际上eclipse的一切快捷键都不能用了
我看了下导入项目的preference,发现连c++ build选项都没有,觉得问题可能在于导入的项目没有语言(c++, c, java等等)信息,以至于被eclipse当成没有语言属性的general项目,快捷键这种依赖于编程语言的东西自然也就没办法用了
解决办法:
依然导入远程的github project到本地,在mac os下就是放在~/git/remoteproject下,linux应该一样的。然后import C/C++ -> Existing code as makefile project -> Browser ->选中remoteproject,也就是说我们手动创建C++项目,不再依靠egit自动生成新创建的项目需要自己取项目名字(直接从github导入的话名字不需要自己取得),除此之外一切特征都和我们期望的一致,可以switch to other branch, function declaration, call hierarchy都可以用了
值得注意的是,有些项目导进来后可以直接用,有些就需要按照上述的流程走一遭,不知道为何
参考:
中文没找到相关资料,英文的话找到了这个eclipse m2e: can't open declarations after importing maven projects
问题的描述和我几乎一样,但是没人回答:(
下面这个up主的问题和我也差不多,VonC同学回答给了我解决问题的启发(他的最后一句话)
You could also use the "Import existing project" option, if your GitHub repo had versioned the
.projectand
.classpathfile, but that may not be the case here.
Importing a GitHub project into Eclipse
相关文章推荐
- eclipse导入cocos2dx项目,CDT无法工作解决方法
- 关于项目文件导入打开报:无法识别元素 <Target> 中的属性“Returns”错误解决方法
- 关于项目文件导入打开报:无法识别元素 <Target> 中的属性“Returns”错误解决方法
- Eclipse导入外部项目无法识别为web项目并且无法在部署到tomcat下解决方法
- Eclipse集成SVN导入项目时报错:cannot map the project with svn provider的解决办法
- 解决eclipse CDT fatal error: cannot open file 'kernel32.lib'
- cocos2dx3.4-android项目eclipse运行报错CDT',Properties下c/c++build无法打开
- 解决Eclipse导入项目是提示错误:Some projects cannot be imported because they already exist in the workspace
- Android无法导入下载好的项目(和Eclipse中已经存在的项目命名一样导致冲突)解决办法
- Android导入的项目再次启动eclipse时提示The import android cannot be resolved的解决办法
- Android无法导入下载好的项目(和Eclipse中已经存在的项目命名一样导致冲突)解决办法
- eclipse打开或导入其他项目时乱码的解决方法
- Android无法导入下载好的项目(和Eclipse中已经存在的项目命名一样导致冲突)解决办法
- 解决eclipse插件openextern无法打开依赖jar包的问题 推荐
- Windows7下无法打开chm(mk:@MSITStore:路径[cannot open the file mk@MSITstore:路径]),chm索引就关闭的解决办法
- Android无法导入下载好的项目(和Eclipse中已经存在的项目命名一样导致冲突)解决办法
- 把github上没提供部分支持库的的项目导入eclipse时发生错误的解决思路
- Eclipse无法导入现有项目的解决方法
- [导入]用openoffice.org来修复因为excel2000的bug而导致无法打开的excel文档
- 解决bug:在eclipse中导入Android项目时报错: “invalid resource directory name bin/res/crunch”