"fatal error: cg_config.h: No such file or directory" error when trying to use make command
"fatal error: cg_config.h: No such file or directory" error when trying to use make command
之前的 Whosebug 线程位于 here。我的问题发生了很大变化,以至于我认为应该创建一个新线程。我正在使用 CentOS8
我正在安装 a tool called wave-gui and having a real hard time (as you can see from the last thread). My current problem is that a file called cg_config.h is no where to be found when I use the make command (I also get errors 1 and 2). All of the troubleshooting steps that got me to this point are located in the previous thread。
我已经复制粘贴了下面 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 2
app.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 1
SDL2 网站说只需使用“sudo yum install 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 得到类似的输出。
我使用“yum search 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 yum install baresip-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.0.so.0”,得到了另一个“no match for argument”
编辑 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
当我使用命令“sudo yum install glfw”时,我得到以下输出:
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。只是为了看看是否能解决任何问题。可能不会,但尝试一下也无妨。
也许路径变量或其他东西无法访问它?
在 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 存储库是个好主意。
之前的 Whosebug 线程位于 here。我的问题发生了很大变化,以至于我认为应该创建一个新线程。我正在使用 CentOS8
我正在安装 a tool called wave-gui and having a real hard time (as you can see from the last thread). My current problem is that a file called cg_config.h is no where to be found when I use the make command (I also get errors 1 and 2). All of the troubleshooting steps that got me to this point are located in the previous thread。
我已经复制粘贴了下面 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 2
app.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 1
SDL2 网站说只需使用“sudo yum install 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 得到类似的输出。
我使用“yum search 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 yum install baresip-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.0.so.0”,得到了另一个“no match for argument”
编辑 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
当我使用命令“sudo yum install glfw”时,我得到以下输出:
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。只是为了看看是否能解决任何问题。可能不会,但尝试一下也无妨。 也许路径变量或其他东西无法访问它?
在 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 存储库是个好主意。