1. 安裝
從官網下載最新版本的Clion
https://www.jetbrains.com/clion/
並解壓到指定的目錄,例如:
/home/xkc/software/clion-2017.2.3
默認Clion可以免費使用30天,學生可以憑借學生證,免費使用的話可以申請一年.
授權方法:激活時選擇License server,填入http://idea.irfen.me/ 點擊Active即可。
2.環境變量配置
a.配置環境變量
打開 .bashrc文件修改內容
vim ~/.bashrc
export PATH=/home/xkc/software/clion-2017.2.3/bin:${PATH}
修改后退出,使修改生效
source ~/.bashrc
b.啟動
在終端中輸入clion.sh 啟動
3.導入項目
在ros下進行斷點調試
- With your console, go into your ROS workspace and source the respective
setup.bashfile. for instance: source devel/setup.bash - Go to the
srcdirectory of your workspace. - Start CLion from the console from your
srcdirectory. for instance: type the command in the terminator: clion.sh - Close any open projects in CLion and select
Import Project from Sources - Select ONLY the
srcdirectory in your workspace for the import. - If CLion complains about
CMakeList.txtalready existing simply clickOpen Project - CLion will build symbols for several minutes, then you should be ready to go.
如下圖所示:
4.調試項目
在軟件IDE的右上角有調試的選項,如下圖所示
Clion會自動的識別可編譯的庫和執行程序,我們這里選擇test可執行文件,只要點擊三角箭頭和調試蟲子,就可以進行相應的調試開發了.使用起來可謂是相當的人性化,難怪要收費了.
Clion可以輕松的進行斷點調試 ,如下圖所示:

