背景
平常學習C++,也就是看看書、在vim裏寫寫代碼。在平常項目開發中,也是邊看書(一是系統性理解、二是找找有什麼更好的代碼編寫方式)邊寫代碼,會順帶看看別人的代碼怎麼寫的?
平常學習習慣:
先在github上申請一個帳號,而後建一個respo。
以前習慣用vim配合g++寫代碼。這兩天開始研究CLion IDE工具哈!
CLion是一款專爲開發C及C++所設計的跨平臺IDE。它是以
IntelliJ爲基礎設計的,包含了許多智能功能來提升開發人員的生產力,提升開發人員的工做效率。
先安裝CLion
在註冊的時候,用url的方式進行註冊(其餘兩種方式最好不要用,問題不少)。這個在網上搜索吧?!我沒有留檔抱歉!?誰找到了也給一份哈。
設計個簡單的C++ 代碼框架
CMakeList.txt文件介紹
一、指定頭文件目錄
include_directories(src/include)
二、指定原始目錄,不要忘記添加第二個默認參數 dir_srcs
aux_source_directory(src/main dir_srcs)
三、添加要編譯的可執行文件。注意,經過變量WORK來編譯
set(WORK ${dir_srcs})
add_executable(work ${WORK})
具體如圖:
## 愉快的運行代碼吧!
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
CMakeLists.txt 有意思的case
1) 配置調試html
![](http://static.javashuo.com/static/loading.gif)
2) 調用子目錄裏的CMakeLists.txtgit
![](http://static.javashuo.com/static/loading.gif)
3) 適配不一樣的環境(debug、release、test_all、...)github
編譯時傳遞編程
![](http://static.javashuo.com/static/loading.gif)
進行變量區分vim
![](http://static.javashuo.com/static/loading.gif)
配置git
問題
CLion是否能在一個windows裏開多個project?答案:不能
官方文檔windows
![](http://static.javashuo.com/static/loading.gif)
資料共享
## 共享庫(.so)與靜態庫(.a)相關資料
##協程庫、並行編程庫
推薦