美文网首页
Eclipse经验总结——快捷键、添加库、编译开关...

Eclipse经验总结——快捷键、添加库、编译开关...

作者: fantasy5328 | 来源:发表于2020-01-16 19:01 被阅读0次

Eclipse的常用操作:
(本文中涉及的运行环境一般是在linux环境中,版本是Nsight Eclipse Edition)

1.部分常用快捷键

  • 全局 撤销重构 Alt+Shift+Z
  • 格式化 Ctrl+Shift+F
  • 全局 快速修正 Ctrl1+1
  • 光标移动:alt+箭头

2.打开文件夹
如果你经常需要在Eclipse里打开相关资源文件所在的文件夹,比较麻烦,要右键,属性,在Location一栏中把所在的文件夹拷贝一下,然后再去资源管理器里输入这个路径,回车,打开它。

3.打开已有的eclipse工程
file--import--existing project into workspace

4.
注意:在某一个编译环境里设置,无效!要在项目里设置。

  • include:
    项目--Properties--c/c++ General--Paths and Symbols--includes
  • 添加静态库.a:
    项目--Properties--c/c++ General--Paths and Symbols--Library Paths
  • 添加动态库:
    项目--Properties--build--Build--GCC C++Linker --Libraries : e.g. -lfstack
  • 编译开关:
    项目--Properties--Build--Settings--Tool Settings--Symbols:e.g. -D MTCP
  • xxx
    项目--Properties--build--Build--GCC C++Compliler --dialect

5.添加c++11支持

  • nvcc--项目右键property--build--settings--tool settings--Code Generation
  • 普通GCC G++:
    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_CXX0X(ensure to append and prepend two underscores) into "Name" and leave "Value" blank.
    Hit Apply, do whatever it asks you to do, then hit OK.

6.rdc-setting
Project...Properties...Build...Settings--cuda--seperate compilation

7.背景颜色

8.不检查语法/拼写错误

10.一些bug调试经验
1.创建makefile项目时 如果选择crossGCC有时候会出现报错误报(编译可以通过)的情况,如果选择linux gcc则不会出现这种情况

相关文章

网友评论

      本文标题:Eclipse经验总结——快捷键、添加库、编译开关...

      本文链接:https://www.haomeiwen.com/subject/mltqzctx.html