用于此操作的前一个堆栈溢出线程位于这里。我的问题已经发生了很大变化,所以我认为应该做一个新的线程。我正在使用CentOS8
我正在安装一种叫做波规的工具,并且遇到了很大的困难(正如您从最后一个线程中可以看到的那样)。我当前的问题是,当我使用make命令时,名为cg_config.h的文件是找不到的(我还得到了错误1和2)。将我带到这一点的所有故障排除步骤都位于前面的线程中。
我已经复制粘贴了下面make命令的输出,以及下面的输出中提到的"main“目录的内容。
-- Creating program 'wave-gui' with sources:
-- main.cpp
-- app.cpp
-- core.cpp
-- ui.cpp
-- data.cpp
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.11)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ellingtonj/wave-gui
Scanning dependencies of target wave-gui
[ 16%] Building CXX object CMakeFiles/wave-gui.dir/main.o
/home/ellingtonj/wave-gui/main/main.cpp:10:10: fatal error: cg_config.h: No such file or directory
#include "cg_config.h"
^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/wave-gui.dir/build.make:63: CMakeFiles/wave-gui.dir/main.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/wave-gui.dir/all] Error 2
make: *** [makefile:130: all] Error 2app.cpp CMakeLists.txt core.h data.h ui.cpp
app.h core.cpp data.cpp main.cpp ui.h编辑1:从工具中完全删除目录并重新克隆它,并运行这些步骤。新的错误。这一次它找不到SDL2。(进展顺利!)
mkdir -p build && cd build && cmake .. && make
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindSDL2.cmake:173 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:16 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeOutput.log".
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:2: all] Error 1SDL2网站说,只需使用"sudo安装SDL2“即可。当我使用这个命令时,我得到以下输出:
Last metadata expiration check: 1:25:41 ago on Mon 26 Oct 2020 09:54:58 AM EDT.
No match for argument: SDL2
Error: Unable to find a match: SDL2使用相同的命令,但使用SDL2-devel获得类似的输出。
我使用了“SDL2”并获得了以下输出:
Last metadata expiration check: 1:26:51 ago on Mon 26 Oct 2020 09:51:55 AM EDT.
========================================= Summary Matched: SDL2 =========================================
baresip-sdl.x86_64 : SDL2 video output driver for baresip
[ellingtonj@localhost ~]$ sudo yum install SDL2-devel
Last metadata expiration check: 1:24:08 ago on Mon 26 Oct 2020 09:54:58 AM EDT.
No match for argument: SDL2-devel
Error: Unable to find a match: SDL2-devel
[ellingtonj@localhost ~]$ yum search SDL2
Last metadata expiration check: 1:28:11 ago on Mon 26 Oct 2020 09:51:55 AM EDT.
========================================= Summary Matched: SDL2 =========================================
baresip-sdl.x86_64 : SDL2 video output driver for baresip然后,我尝试了"sudo安装裸this sdl.x86_64“,它为我提供了以下输出:
Last metadata expiration check: 1:25:25 ago on Mon 26 Oct 2020 09:54:58 AM EDT.
Error:
Problem: conflicting requests
- nothing provides libSDL2-2.0.so.0()(64bit) needed by baresip-sdl-1.0.0-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)为了好玩,我输入了"sudo yum install libSDL-2.0.so.so.0“,并得到了另一个”不匹配的论点“。
编辑2:我听从了yflelion的建议,被称为sdl2,glfw3和fftw。我现在明白了这个错误:
mkdir -p build && cd build && cmake .. && make
-- Checking for one of the modules 'glfw3'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message):
None of the required 'glfw3' found
Call Stack (most recent call first):
CMakeLists.txt:17 (pkg_search_module)
-- FFTW support enabled.
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake/Modules/FindOpenGL.cmake:395 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
external/imgui/CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeOutput.log".
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:2: all] Error 1我现在正在考虑安装OpenGL,但正如前面的线程中所指出的,我现在已经不知所措了。我还补充说(在几个人的要求下)我正在使用CentOS8。
编辑3:我以为我已经安装了glfw3,但是在安装OpenGL之后我得到了以下错误:
mkdir -p build && cd build && cmake .. && make
-- Checking for one of the modules 'glfw3'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message):
None of the required 'glfw3' found
Call Stack (most recent call first):
CMakeLists.txt:17 (pkg_search_module)
-- FFTW support enabled.
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:270 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
external/imgui/CMakeLists.txt:4 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Checking for one of the modules 'glfw3'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message):
None of the required 'glfw3' found
Call Stack (most recent call first):
external/imgui/CMakeLists.txt:12 (pkg_search_module)
-- Creating program 'wave-gui' with sources:
-- main.cpp
-- app.cpp
-- core.cpp
-- ui.cpp
-- data.cpp
-- Configuring incomplete, errors occurred!
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeOutput.log".
See also "/home/ellingtonj/wave-gui/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:2: all] Error 1当我使用命令“”时,我得到以下输出:
Last metadata expiration check: 0:07:49 ago on Mon 26 Oct 2020 12:24:38 PM EDT.
Package glfw-1:3.3-2.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!编辑4:安装glfw-devel并尝试再次运行make命令。这一次,它得到了比以往任何时候(再次!)进展!)。但还是会有错误。
mkdir -p build && cd build && cmake .. && make
-- Checking for one of the modules 'glfw3'
-- FFTW support enabled.
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:270 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib64/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib64/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib64/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
external/imgui/CMakeLists.txt:4 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Creating program 'wave-gui' with sources:
-- main.cpp
-- app.cpp
-- core.cpp
-- ui.cpp
-- data.cpp
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ellingtonj/wave-gui/build
make[1]: Entering directory '/home/ellingtonj/wave-gui/build'
make[2]: Entering directory '/home/ellingtonj/wave-gui/build'
make[3]: Entering directory '/home/ellingtonj/wave-gui/build'
Scanning dependencies of target cg_core
make[3]: Leaving directory '/home/ellingtonj/wave-gui/build'
make[3]: Entering directory '/home/ellingtonj/wave-gui/build'
[ 4%] Building CXX object src/CMakeFiles/cg_core.dir/cg_config.cpp.o
[ 8%] Building CXX object src/CMakeFiles/cg_core.dir/cg_logger.cpp.o
[ 12%] Building CXX object src/CMakeFiles/cg_core.dir/cg_glfw3.cpp.o
[ 16%] Building CXX object src/CMakeFiles/cg_core.dir/cg_keyboard.cpp.o
[ 20%] Building CXX object src/CMakeFiles/cg_core.dir/cg_mouse.cpp.o
[ 25%] Building CXX object src/CMakeFiles/cg_core.dir/cg_timer.cpp.o
[ 29%] Building CXX object src/CMakeFiles/cg_core.dir/cg_window.cpp.o
[ 33%] Building CXX object src/CMakeFiles/cg_core.dir/cg_window2d.cpp.o
[ 37%] Linking CXX static library libcg_core.a
make[3]: Leaving directory '/home/ellingtonj/wave-gui/build'
[ 37%] Built target cg_core
make[3]: Entering directory '/home/ellingtonj/wave-gui/build'
Scanning dependencies of target ImGui
make[3]: Leaving directory '/home/ellingtonj/wave-gui/build'
make[3]: Entering directory '/home/ellingtonj/wave-gui/build'
[ 41%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/imgui.cpp.o
[ 45%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/imgui_demo.cpp.o
[ 50%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/imgui_draw.cpp.o
[ 54%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/imgui_user.cpp.o
[ 58%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/imgui_widgets.cpp.o
[ 62%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/examples/imgui_impl_glfw.cpp.o
[ 66%] Building CXX object external/imgui/CMakeFiles/ImGui.dir/examples/imgui_impl_opengl3.cpp.o
[ 70%] Building C object external/imgui/CMakeFiles/ImGui.dir/examples/libs/gl3w/GL/gl3w.c.o
[ 75%] Linking CXX shared library libImGui.so
/usr/bin/ld: cannot find -lXrandr
/usr/bin/ld: cannot find -lXi
/usr/bin/ld: cannot find -lXinerama
/usr/bin/ld: cannot find -lXxf86vm
/usr/bin/ld: cannot find -lXcursor
collect2: error: ld returned 1 exit status
make[3]: *** [external/imgui/CMakeFiles/ImGui.dir/build.make:191: external/imgui/libImGui.so] Error 1
make[3]: Leaving directory '/home/ellingtonj/wave-gui/build'
make[2]: *** [CMakeFiles/Makefile2:159: external/imgui/CMakeFiles/ImGui.dir/all] Error 2
make[2]: Leaving directory '/home/ellingtonj/wave-gui/build'
make[1]: *** [Makefile:130: all] Error 2
make[1]: Leaving directory '/home/ellingtonj/wave-gui/build'
make: *** [Makefile:2: all] Error 2这似乎是IMGui的一个问题。特别是-lX-一些东西。我将尝试重新安装ImGui,看看这是否有帮助。也可能重新启动VM。看看这能不能治好什么。也许不会,但试一试也没什么坏处。可能是路径变量什么的无法访问?
发布于 2020-10-26 15:55:28
在xubuntu 18.04上,为了构建这个项目,我必须安装:
libsdl2-dev,libglfw3-dev,libfftw3-dev。
要在Centos 7中安装它们(您在前面的线程中提到了centos ):
https://centos.pkgs.org/7/epel-x86_64/SDL2-2.0.10-1.el7.x86_64.rpm.html
https://centos.pkgs.org/7/epel-x86_64/SDL2-devel-2.0.10-1.el7.x86_64.rpm.html
https://centos.pkgs.org/7/epel-x86_64/glfw-3.2.1-2.el7.x86_64.rpm.html
https://centos.pkgs.org/7/epel-x86_64/glfw-devel-3.2.1-2.el7.x86_64.rpm.html
https://centos.pkgs.org/7/centos-x86_64/fftw-devel-3.3.3-8.el7.x86_64.rpm.html启用@Rup中提到的EPEL存储库是个好主意。
https://stackoverflow.com/questions/64539139
复制相似问题