cmake嘗試檢測GCC版本報錯 & ubuntu下多版本編譯器的安裝、切換


一、cmake嘗試檢測GCC版本報錯

本人嘗試編譯指定commit版本的MRPT庫,報錯如下,

CMake Error at cmakemodules/script_detect_gcc.cmake:16 (LIST):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:83 (include)


CMake Error at cmakemodules/script_detect_gcc.cmake:17 (LIST):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:83 (include)

注:本機gcc版本7.4.0,cmake版本3.5.1。

 

錯誤排查流程:

1. 排查出報錯的位置。在 ./cmakemodules/script_detect_gcc.cmake 文件的16-17行。

2. 嘗試描述該問題,即弄清楚問題是什么——“cmake detect gcc version, get error 'list get given empty list' ”

3. 搜索該問題,一擊必中。

https://answers.opencv.org/question/65548/cmake-error-at-cmakeopencvdetectcxxcompilercmake/

https://github.com/opencv/opencv/pull/9430/files

 

二、 ubuntu下多版本GCC、G++的安裝、切換

https://www.jianshu.com/p/f66eed3a3a25


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM