cmake無法找到vs2015的c compiler

運行cmake的configure失敗,各種蛋疼


提示錯誤爲:

CMake does not find Visual C compiler


老問題了,每次軟件升級都帶來一堆兼容問題。網上扒了一圈,說什麼的都有。其實解決方式也很簡單,


1. Open VS studio command prompt tool (as an administrator)
2. Navigate to where you have the Cmake executable
3. Run Cmake.exe 
4. Proceed as usual to select build and source folder 
5. Select the appropriate VS compiler and hit the configure button


簡單的說就是,用管理員權限運行vs的VS studio command prompt tool,在開始菜單的vs2015文件夾下面有,注意有好幾個命令行,別選錯了。


啓動後,其實就是vs的環境變量進入到命令行的上下文了,然後在命令行下cd到cmake路徑,直接啓動cmake,這種方式啓動的cmake就能根據上下文找到對應的c編譯器,然後就能正確的 執行configure

命令,然後就該咋地咋地了。


兼容性的鍋,也不好說是誰的,貌似是微軟更大些,怎麼環境變量都沒設置好呢?


參考:http://stackoverflow.com/questions/31619296/cmake-does-not-find-visual-c-compiler

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章