Unbutu虚拟机+eclipse+CDT编译调试环境搭建
问题1: 安装CDT,直接Help->eclipse Market space-> 搜cdt , install,等待重启即可.
问题2:C++变量不识别vector ’could not be resolved
这是库的头文件没加好,右键Properties->C++ Build->Enviroment,增加两个环境变量:
C_INCLUDE_PATH =/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu: /usr/include
CPLUS_INCLUDE_PATH=/usr/include/c++/9:/usr/include/x86_64-linux-gnu/c++/9:/usr/include/c++/9/backward:/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include
然后重启eclipse,解决。
问题3:右键 build时,提示: make: *** No rule to make target `all'. Stop.
参考eclipse c/c++IDE 编译 make: *** No rule to make target `all'. Stop. 解决办法_make: *** no rule to make target 'all'. stop.-CSDN博客,改成build_project,然后右键clean,然后build,即可.
4. Debug发现:Lanch failed Binary not found
5.Debug时发现CDT太慢
参考Eclipse/CDT速度慢,占用内存大的问题的可用解决方案-CSDN博客 ,Windows->Preferences->C/C++, 只找到index选项,没找到"Follow #include's when parsing working copies",也没有去掉“Windows->Preferences-> C/C++->Editor->Code Assist, Auto activation下面3个框”
只去掉index后确实提升很多,可以正常调试了
版本号: eclipse-jee-2024-12-R-linux-gtk-x86_64.tar.gz, CDT11.6(2024-6)