Eclipse-cdt 来索引我的 C++仅代码
是否可以让 Eclipse 索引我的 C++ 代码(使用 cmake 构建)?
我更喜欢使用 bash 提示符来编译/运行实际代码,但我想在像 eclipse 这样的编辑器中编写代码,这样我就可以轻松地遵循定义并具有自动完成功能。
我担心 Eclipse 中的 C++ 索引在某些时候会变得不同步,因为我是在外部编译的。
现在我正在使用的方法是这个方法: cmake -G"Eclipse CDT4 - Unix Makefiles"
似乎可以工作,但是当我导入它时,这种方法似乎也会导致 Eclipse 重建我的项目。
Is it possible to have eclipse index my C++ code (built using cmake)?
I prefer to compile/run the actual code using a bash prompt, but I would like to write code in an editor like eclipse so I can easily follow definitions and have auto-completion.
I'm worried the C++ indexing in eclipse will become out of sync at some point because I'm compiling outside.
Right now the method I'm using is this method:
cmake -G"Eclipse CDT4 - Unix Makefiles"
which appears to work, but it seems like this method also causes eclipse to rebuild my project when I import it in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我目前使用 Eclipse 作为编辑器,其索引位于 Eclipse 外部构建的项目上。只需关闭项目中的所有自动构建选项,只要文件发生更改,它仍然会为您索引代码。我的项目使用一堆特殊脚本来执行构建,因此我只是将其保留为现有代码中的默认 C++ 项目,并在创建项目时使用 CDT 构建器。
Yes, I currently use Eclipse as an editor with its index on a project that is built outside of eclipse. Just turn off all the automatic build options in the project, and it will still index the code for you whenever a file changes. My project uses a bunch of special scripts to perform the build, so I just left it as a default c++ project from existing code, using the CDT builder when I created the project.