使用cmake编译boost时发生Bash错误

vybvopom  于 2022-11-24  发布在  其他
关注(0)|答案(1)|浏览(146)

我试图编译boost(作为另一个库安装的一部分),但它向我报告我的gcc坏了。
当我跑步时候,

-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/usr/bin/gcc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp


  Run Build Command:/usr/bin/make "cmTryCompileExec3895803733/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec3895803733.dir/build.make
  CMakeFiles/cmTryCompileExec3895803733.dir/build

  make[1]: Entering directory
  `/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp'

  /usr/bin/cmake -E cmake_progress_report
  /home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object
  CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o

  /usr/bin/gcc -m64 -O3 -march=native (Default on Linux) -o
  CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o -c
  /home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/testCCompiler.c

  /bin/sh: 1: Syntax error: "(" unexpected

  make[1]: *** [CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o]
  Error 2

  make[1]: Leaving directory
  `/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec3895803733/fast] Error 2



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

-- Configuring incomplete, errors occurred!

我真的不知道哪里出了问题。当我用C语言制作我自己的cmake项目时,我编译它没有问题。

ni65a41a

ni65a41a1#

您得到的错误不是来自gcc,而是来自/bin/sh,没有迹象表明问题实际上与gcc本身有关。

/usr/bin/gcc -m64 -O3 -march=native (Default on Linux) -o
CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o -c
/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/testCCompiler.c

/bin/sh: 1: Syntax error: "(" unexpected

这个值(Default on Linux)是否是您在某处输入的?

相关问题