【问题标题】:Error Compiling google liquidfun on Linux Ubuntu在 Linux Ubuntu 上编译 google liquidfun 时出错
【发布时间】:2021-03-18 17:15:32
【问题描述】:

我正在尝试按照此页面上的说明在 ubuntu 20.10 上编译 Liquidfun 1.10:https://google.github.io/liquidfun/Building/html/md__building_linux.html

当我运行命令时:

cd liquidfun/Box2D
cmake -G'Unix Makefiles'
make

我收到各种错误并且构建失败。 这是屏幕输出:

cmake -G'Unix Makefiles'
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (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/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/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):
  CMakeLists.txt:120 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::X11


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::ICE


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::SM


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xau


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xcursor


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xdmcp


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xext


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xxf86vm


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xfixes


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xi


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xinerama


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xkb


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xmu


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xpm


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xrandr


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  X11::Xrender


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xss


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xt


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xutil


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to: X11::Xv


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Threads::Threads


CMake Error at CMakeLists.txt:158 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  Threads::Threads


-- Configuring incomplete, errors occurred!

还有其他人遇到过这个问题吗?

感谢任何帮助

【问题讨论】:

    标签: c++ ubuntu cmake liquidfun


    【解决方案1】:

    他们通过重新定义add_library 命令:liquidfun/Box2D/CMakeLists.txt:101 来玩肮脏的游戏。他们似乎忘记了一些 FindXXX.cmake 脚本可能会使用这个 add_library 创建 IMPORTED 目标。

    您可以尝试删除此重新定义:删除从function(add_library name)endfunction(add_library) 的行。但要准备好在未记录的位置创建一些库。

    无论如何,这是项目中的一个错误,因此可以(应该)向开发人员报告。


    为了克服“未提供源代码或二进制目录”的警告。在 cmake 调用中添加. 参数:

    cmake -G'Unix Makefiles' .
    

    此参数将指定一个源目录,在源内构建的情况下,该目录与构建目录相同。 (虽然 CMake 不鼓励使用源内构建而不是源外构建,但有些项目仅支持源内构建)。

    【讨论】:

    • 感谢您的回复。非常有用的信息。配置成功。顺便说一句,当我点击 make 时,出现以下错误: b2DynamicTree.cpp:31:56: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct b2TreeNode’;改用赋值或值初始化 [-Werror=class-memaccess] 31 | memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode)); b2DynamicTree.h:28:8: 注意:此处声明的‘struct b2TreeNode’ 28 | struct b2TreeNode cc1plus:所有警告都被视为错误 build.make:661:
    • 因此,该项目不适合现代 C++ 标准、现代编译器(以及现代 CMake)。您可能会尝试使用较旧的编译器来构建项目,或者可能会尝试禁用那些类型的编译器警告/错误,这会阻止构建项目。有关使用 CMake 更改编译器选项的信息,请参阅 that question
    • 再次感谢您的回复。已经禁用警告并向前迈出了一小步。 libglut 有问题。如果我禁用 libglut 的构建,则编译成功,但无法进行 make install,因此未安装该库。顺便说一句,我注意到构建了一个 lib libliquidfun.a。
    猜你喜欢
    • 1970-01-01
    • 2014-12-05
    • 2013-11-21
    • 1970-01-01
    • 1970-01-01
    • 2016-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多