0

我正在尝试将 gcc 编译器从版本 8.3 升级到 8.4。官方 gcc 文档建议从源方法编译,平均需要 5 小时。我需要 gcc-8.4 版本来使用 CMAKE 构建一些项目组件。我尝试从位于和y中的同一路径的x (我从源代码编译 gcc-8.4)复制二进制文件,但 cmake 产生以下错误 /usr/local/bin/usr/local/bin

pi@raspberrypi:~/vingman/loki/bld $ cmake -DUNIT_TESTS=OFF -DPLATFORM=RASPI ../
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- broken
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:45 (message):
  The C++ compiler

"/usr/local/bin/c++"



is not able to compile a simple test program.

  It fails with the following output:

Change Dir: /home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_d4b13/fast"
/usr/bin/make -f CMakeFiles/cmTC_d4b13.dir/build.make CMakeFiles/cmTC_d4b13.dir/build
make[1]: Entering directory '/home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_d4b13.dir/testCXXCompiler.cxx.o
/usr/local/bin/c++     -o CMakeFiles/cmTC_d4b13.dir/testCXXCompiler.cxx.o -c /home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
c++: error trying to exec 'cc1plus': execvp: No such file or directory
make[1]: *** [CMakeFiles/cmTC_d4b13.dir/build.make:66: CMakeFiles/cmTC_d4b13.dir/testCXXCompiler.cxx.o] Error 1
make[1]: Leaving directory '/home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_d4b13/fast] Error 2



CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)


-- Configuring incomplete, errors occurred!
See also "/home/pi/vingman/loki/bld/CMakeFiles/CMakeOutput.log".
See also "/home/pi/vingman/loki/bld/CMakeFiles/CMakeError.log".

但是,当我检查gcc --versiony,它显示版本 8.4

pi@raspberrypi:~/vingman/loki/bld $ gcc --version
gcc (GCC) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

任何帮助或建议表示赞赏。提前致谢。CMakeError 日志文件的输出如下

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags:  

The output was: 1 c++: error trying to exec 'cc1plus': execvp: No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: -c 

The output was: 1 c++: error trying to exec 'cc1plus': execvp: No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: --c++ 

The output was: 1 c++: error: unrecognized command line option ‘--c++’


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: --ec++ 

The output was: 1 c++: error: unrecognized command line option ‘--ec++’; did you mean ‘-Weffc++’?


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags:  

The output was: 1 c++: error trying to exec 'cc1plus': execvp: No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: -c 

The output was: 1 c++: error trying to exec 'cc1plus': execvp: No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: --c++ 

The output was: 1 c++: error: unrecognized command line option ‘--c++’


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /usr/local/bin/c++  Build flags:  Id flags: --ec++ 

The output was: 1 c++: error: unrecognized command line option ‘--ec++’; did you mean ‘-Weffc++’?


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler": c++: fatal error: no input files compilation terminated. Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler": c++: fatal error: no input files compilation terminated. Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags:  

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -c 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -Aa 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -D__CLASSIC_C__ 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags:  

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -c 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -Aa 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /usr/local/bin/gcc  Build flags:  Id flags: -D__CLASSIC_C__ 

The output was: 1 gcc: error trying to exec 'cc1': execvp: No such file or directory


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler": gcc: fatal error: no input files compilation terminated. Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler": gcc: fatal error: no input files compilation terminated. Determining if the CXX compiler works failed with the following output: Change Dir: /home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_4237f/fast" /usr/bin/make -f CMakeFiles/cmTC_4237f.dir/build.make CMakeFiles/cmTC_4237f.dir/build make[1]: Entering directory '/home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_4237f.dir/testCXXCompiler.cxx.o /usr/local/bin/c++    
-o CMakeFiles/cmTC_4237f.dir/testCXXCompiler.cxx.o -c /home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp/testCXXCompiler.cxx c++: error trying to exec 'cc1plus': execvp: No such file or directory make[1]: *** [CMakeFiles/cmTC_4237f.dir/build.make:66: CMakeFiles/cmTC_4237f.dir/testCXXCompiler.cxx.o] Error 1 make[1]: Leaving directory '/home/pi/vingman/loki/bld/CMakeFiles/CMakeTmp' make: *** [Makefile:121: cmTC_4237f/fast] Error 2
4

0 回答 0