“致命错误:cg_config.h:没有这样的文件或目录"尝试使用make命令时出错 [英] "fatal error: cg_config.h: No such file or directory" error when trying to use make command

查看:60
本文介绍了“致命错误:cg_config.h:没有这样的文件或目录"尝试使用make命令时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前的stackoverflow线程位于

The previous stackoverflow thread for this is located here. My problem has changed so much that I figured a new thread should be made. I am using CentOS8

我正在安装名为wave-gui的工具,但确实很难(如您在最后一个线程中所见).我当前的问题是,当我使用make命令时,找不到cg_config.h文件(我也收到错误1和2).到目前为止,所有解决问题的步骤都位于前面的

I am working on installing 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"的内容在下面的输出中提到的目录.

I have copy-pasted the output of the make command below, and the contents of the "main" directory mentioned in the output below that.

-- 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

从工具中完全删除目录,然后重新克隆目录并执行所有步骤.有一个新的错误.这次找不到SDL2.(是的,进步!)

Edit 1: Completely deleted the directory from the tool and recloned it and ran through the steps. Got a new error. This time it couldn't find SDL2. (yay progress!)

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".当我使用此命令时,将得到以下输出:

The SDL2 website says to simply use "sudo yum install SDL2." When I use this command I get the following output:

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时将获得类似的输出.

Using the same command, but with SDL2-devel gets a similar output.

我使用了"yum search SDL2"并得到以下输出:

I used "yum search SDL2" and got this output:

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 overlaysip-sdl.x86_64".这给了我这个输出:

I then tried "sudo yum install baresip-sdl.x86_64" which gives me this output:

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&";并获得另一个参数不匹配"

Just for fun, I input "sudo yum install libSDL-2.0.so.0.so.0" and got another "no match for argument"

我遵循yflelion的建议,并使用了sdl2 glfw3和fftw.我现在收到此错误:

Edit 2: I followed the advice of yflelion and isntalled sdl2 glfw3 and fftw. I get this error now:

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的信息.

I'm looking into installing OpenGL now, but as noted in the previous thread I'm in way over my head right now. I also added (at the behest of several people) that I am using CentOS8.

我以为我已经安装了glfw3,但是在安装OpenGL之后我得到了这个错误:

Edit 3: I thought I had installed glfw3, but after installing OpenGL I got this error:

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"时,我得到以下输出:

When I use the command "sudo yum install glfw" I gete the following output:

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!

安装了glfw-devel并尝试再次运行make命令.这次,它比以往任何时候都更进一步(再次!进步!!).虽然仍然出现错误.

Edit 4: installed glfw-devel and tried to run the make command once more. This time it got further than it ever has (again! Progress!!). Still getting errors though.

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.只是看看是否可以解决任何问题.可能不会,但是尝试不会受到伤害.也许路径变量无法访问或什么?

This looks to be a problem with IMGui. Specifically the -lX----- stuff. I'm going to try and reinstall ImGui to see if that helps. Might restart the VM, too. Just to see if that fixes anything. Probably won't, but it doesn't hurt to try. Maybe it's not accessible to the path variable or something?

推荐答案

在xubuntu 18.04上,为了构建此项目,我必须安装:
libsdl2-dev libglfw3-dev libfftw3-dev.

On xubuntu 18.04 , in order to build this project I had to install:
libsdl2-dev libglfw3-dev libfftw3-dev.

要在Centos 7中安装它们(您在上一个线程中提到过centos):

To install them in Centos 7 (you mentioned centos in the previous thread):

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存储库将是一个好主意.

Enabling the EPEL repository as mentioned by @Rup would be a good idea.

这篇关于“致命错误:cg_config.h:没有这样的文件或目录"尝试使用make命令时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆