C++ 我该如何解决这个问题;没有CXX编译器的已知功能“;使用CMake(Linux Mint)编译时

C++ 我该如何解决这个问题;没有CXX编译器的已知功能“;使用CMake(Linux Mint)编译时,c++,cmake,linux-mint,C++,Cmake,Linux Mint,我正在尝试安装此插件: 我遵循了所有步骤(安装了QT,获得了obs studio源代码,然后尝试构建插件): 但是 -- Configuring done CMake Error in CMakeLists.txt: No known features for CXX compiler "" version . -- Build files have been written to: /home/********/obs-v4l2sink/build 这是我第一次使用cm

我正在尝试安装此插件:

我遵循了所有步骤(安装了QT,获得了obs studio源代码,然后尝试构建插件):

但是

 -- Configuring done
CMake Error in CMakeLists.txt:
  No known features for CXX compiler

  ""

  version .


-- Build files have been written to: /home/********/obs-v4l2sink/build
这是我第一次使用
cmake
(而不是
make
)编译,我对编译知之甚少。在安装
cmake
和尝试编译插件之间,我是否错过了任何步骤

根据我在网上的发现,以下是我所做的:

  • build-essential
    已安装
  • c++
    cc
    ,并且都已安装
  • 尝试将
    -DCMAKE\u CXX\u COMPILER=/usr/bin/cc
    添加到
    cmake
    命令行(对c++也做了同样的操作)
当然,我已经完成了
更新和升级

以下是CMakeError.log文件中的内容:

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

The output was:
1
/usr/bin/ld : ne peut pas trouver Scrt1.o : Aucun fichier ou dossier de ce type
/usr/bin/ld : ne peut pas trouver crti.o : Aucun fichier ou dossier de ce type
collect2: error: ld returned 1 exit status


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Determining if the C compiler works failed with the following output:
Change Dir: /home/***********/obs-v4l2sink/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f18b2/fast"
/usr/bin/make -f CMakeFiles/cmTC_f18b2.dir/build.make CMakeFiles/cmTC_f18b2.dir/build
make[1] : on entre dans le répertoire « /home/***********/obs-v4l2sink/build/CMakeFiles/CMakeTmp »
Building C object CMakeFiles/cmTC_f18b2.dir/testCCompiler.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_f18b2.dir/testCCompiler.c.o   -c /home/***********/obs-v4l2sink/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_f18b2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f18b2.dir/link.txt --verbose=1
/usr/bin/cc      CMakeFiles/cmTC_f18b2.dir/testCCompiler.c.o  -o cmTC_f18b2 
/usr/bin/ld : ne peut pas trouver Scrt1.o : Aucun fichier ou dossier de ce type
/usr/bin/ld : ne peut pas trouver crti.o : Aucun fichier ou dossier de ce type
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_f18b2.dir/build.make:97: recipe for target 'cmTC_f18b2' failed
make[1]: *** [cmTC_f18b2] Error 1
make[1] : on quitte le répertoire « /home/***********/obs-v4l2sink/build/CMakeFiles/CMakeTmp »
Makefile:126: recipe for target 'cmTC_f18b2/fast' failed
make: *** [cmTC_f18b2/fast] Error 2


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags:  

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: -c 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --c++ 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND 
Build flags: 
Id flags: --ec++ 

The output was:
No such file or directory


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.
把我的评论变成回答:

这个错误消息很奇怪。它看起来像cFAID以前检测到C++编译器,并正在搜索编译器的特性。但是,现在它找不到该编译器(空编译器名称和版本):

这表明CMake配置过时,清理它可能很有用。尝试完全删除
build
文件夹,然后再次从教程中运行CMake步骤(从创建
build
文件夹开始,如下所示)。这将有助于清除旧的/缓存的CMake设置:

mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install

欢迎来到堆栈溢出!需要澄清的是,CMake不做任何编译。CMake将生成生成系统(例如生成生成文件),然后在运行CMake后,您可以使用
make
或其他命令来启动编译。此外,CMake正在查找编译器功能,但它无法再将编译器打印到屏幕上(
)让我觉得您的配置有问题,可能是您在设置
CMAKE\u CXX\u编译器时反复尝试造成的。尝试删除
build
文件夹,重复此步骤
mkdir build&&cd build
,以及之后的所有步骤。这将清除所有旧的/过时的CMake缓存。。希望这有帮助!非常感谢。它确实有用!
CMake Error in CMakeLists.txt:
  No known features for CXX compiler

  ""

  version .
mkdir build && cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install