AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题

问题[opengl](unix)

Martin Hope
Random Linux User
Asked: 2022-01-04 09:34:37 +0800 CST

如何在 ubuntu 上安装 OpenGL 和 SDL2 库

  • 1

我正在尝试构建 Cube2 Sauerbraten,但我需要 OpenGL 和 SDL2 库来运行 makefile。(我在这里使用 ubuntu)我尝试运行sudo apt-get install --yes software-properties-common g++ make然后sudo apt-get install --yes libsdl2-dev最后sudo apt-get install --yes freeglut3-dev,编译,g++ main.cpp -I /usr/include/SDL2/ -lSDL2 -lGL.

我从https://gist.github.com/dirkk0/cad259e6a3965abb4178获得了这些命令。当我运行它们时,前三个命令工作正常,但最后一个没有工作,给了我这个错误。

optiplex780@super-OptiPlex-780:~$ g++ main.cpp -I /usr/include/SDL2/ -lSDL2  -lGL
cc1plus: fatal error: main.cpp: No such file or directory
compilation terminated.
optiplex780@super-OptiPlex-780:~$

我应该用makefile替换main.cpp吗?

我只是个笨蛋,还是这里有问题?安装软件包后,我尝试进入~/sauerbraten/src目录并运行make install. 我得到了这些错误。

optiplex780@super-OptiPlex-780:~/sauerbraten_2020_12_29_linux/sauerbraten/src$ make install
make    -C enet/ all
make[1]: Entering directory '/home/optiplex780/sauerbraten_2020_12_29_linux/sauerbraten/src/enet'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/optiplex780/sauerbraten_2020_12_29_linux/sauerbraten/src/enet'
g++ -O3 -fomit-frame-pointer -Wall -fsigned-char -o sauer_client shared/crypto.o shared/geom.o shared/stream.o shared/tools.o shared/zip.o engine/3dgui.o engine/bih.o engine/blend.o engine/blob.o engine/client.o engine/command.o engine/console.o engine/cubeloader.o engine/decal.o engine/dynlight.o engine/glare.o engine/grass.o engine/lightmap.o engine/main.o engine/material.o engine/menus.o engine/movie.o engine/normal.o engine/octa.o engine/octaedit.o engine/octarender.o engine/physics.o engine/pvs.o engine/rendergl.o engine/rendermodel.o engine/renderparticles.o engine/rendersky.o engine/rendertext.o engine/renderva.o engine/server.o engine/serverbrowser.o engine/shader.o engine/shadowmap.o engine/sound.o engine/texture.o engine/water.o engine/world.o engine/worldio.o fpsgame/ai.o fpsgame/client.o fpsgame/entities.o fpsgame/fps.o fpsgame/monster.o fpsgame/movable.o fpsgame/render.o fpsgame/scoreboard.o fpsgame/server.o fpsgame/waypoint.o fpsgame/weapon.o -Lenet/.libs -lenet -L/usr/X11R6/lib `sdl-config --libs` -lSDL_image -lSDL_mixer -lz -lGL -lrt
/bin/sh: 1: sdl-config: not found
/usr/bin/ld: cannot find -lSDL_image
/usr/bin/ld: cannot find -lSDL_mixer
collect2: error: ld returned 1 exit status
make: *** [Makefile:163: client] Error 1
optiplex780@super-OptiPlex-780:~/sauerbraten_2020_12_29_linux/sauerbraten/src$
command-line opengl
  • 1 个回答
  • 497 Views
Martin Hope
Hugal31
Asked: 2019-03-28 03:10:14 +0800 CST

无法将 OpenGL ARB_gpu_shader_int64 扩展与 Mesa 一起使用

  • 1

我正在研究 OpenGL 着色器,我需要 uint64_t 类型等...但是,当我执行 glxinfo 时,此扩展不在列表中。

我正在使用 Mesa 18.0.5,并且此页面告诉 17.1.0 的 radeonsi 驱动程序支持该扩展。

我的 GPU 是 AMD Radeon HD 8730M。我正在使用radeon驱动程序,但切换到amdgpu没有帮助。

问题:如何在我的着色器中使用 uint64?通过切换到另一个驱动程序?通过更新 Mesa?还是我的 GPU 太旧了?

我尝试编译的着色器:

#version 450
#extension GL_ARB_gpu_shader5 : enable
#extension GL_ARB_gpu_shader_int64 : enable

void main()
{
  uint64_t foo = 0ul;
}

我有:

0:3(12): warning: extension `GL_ARB_gpu_shader_int64' unsupported in fragment shader
0:7(11): error: syntax error, unexpected NEW_IDENTIFIER, expecting ',' or ';'

glxinfo 输出:

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile,
    [...]
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
    GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth,
    [...]
amd-graphics opengl
  • 1 个回答
  • 412 Views
Martin Hope
mend4x
Asked: 2019-01-31 23:32:21 +0800 CST

无法编译 OpenGL 代码

  • 0

我在笔记本电脑上运行 Linux Mint 19.1 并面临这个问题。当我尝试使用 OpenGL 库编译 C++ 程序时,它说:

$ make
g++     solsys.cpp  -lglut -lGLEW -lGL -lGLU -fpermissive -o solsys
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'solsys' failed
make: *** [solsys] Error 1

当我之前尝试运行已经编译的程序时,但在这台机器上它说

./rotation: error while loading shared libraries: libGLEW.so.1.13: cannot open shared object file: No such file or directory

我实际上理解问题在于库安装不正确,但无法解决。

glxino | grep OpenGL输出这个

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

顺便说一句,我在笔记本电脑上安装 Nvidia 驱动程序时遇到了问题,但后来放弃了。

$lspci | grep "NVIDIA"
04:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] (rev a1)

更新:

$ sudo apt-get install libglew-dev libgl1-mesa-dev libglu1-mesa-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libglu1-mesa-dev is already the newest version (9.0.0-2.1build1).
libglu1-mesa-dev set to manually installed.
libglew-dev is already the newest version (2.0.0-5).
libgl1-mesa-dev is already the newest version (18.0.5-0ubuntu0~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.

...

$ dpkg -l | grep mesa
ii  libegl-mesa0:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the EGL API -- Mesa vendor library
ii  libegl1-mesa:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libegl1-mesa-dev:amd64                     18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the EGL API -- development files
ii  libgl1-mesa-dev:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- GLX development files
ii  libgl1-mesa-dri:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-dri:i386                       18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the OpenGL API -- DRI modules
ii  libgl1-mesa-glx:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libgl1-mesa-glx:i386                       18.0.5-0ubuntu0~18.04.1                     i386         transitional dummy package
ii  libglapi-mesa:amd64                        18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the GL API -- shared library
ii  libglapi-mesa:i386                         18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the GL API -- shared library
ii  libgles2-mesa:amd64                        18.0.5-0ubuntu0~18.04.1                     amd64        transitional dummy package
ii  libgles2-mesa-dev:amd64                    18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL|ES 2.x API -- development files
ii  libglu1-mesa:amd64                         9.0.0-2.1build1                             amd64        Mesa OpenGL utility library (GLU)
ii  libglu1-mesa:i386                          9.0.0-2.1build1                             i386         Mesa OpenGL utility library (GLU)
ii  libglu1-mesa-dev:amd64                     9.0.0-2.1build1                             amd64        Mesa OpenGL utility library -- development files
ii  libglx-mesa0:amd64                         18.0.5-0ubuntu0~18.04.1                     amd64        free implementation of the OpenGL API -- GLX vendor library
ii  libglx-mesa0:i386                          18.0.5-0ubuntu0~18.04.1                     i386         free implementation of the OpenGL API -- GLX vendor library
ii  libosmesa6:amd64                           18.0.5-0ubuntu0~18.04.1                     amd64        Mesa Off-screen rendering extension
ii  libosmesa6:i386                            18.0.5-0ubuntu0~18.04.1                     i386         Mesa Off-screen rendering extension
ii  libwayland-egl1-mesa:amd64                 18.0.5-0ubuntu0~18.04.1                     amd64        implementation of the Wayland EGL platform -- runtime
ii  mesa-common-dev:amd64                      18.0.5-0ubuntu0~18.04.1                     amd64        Developer documentation for Mesa
ii  mesa-utils                                 8.4.0-1                                     amd64        Miscellaneous Mesa GL utilities

连锁:

$ ls -l /usr/lib/x86_64-linux-gnu/libGL.so*
lrwxrwxrwx 1 root root     14 Jan 16 19:09 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.1.0.0
-rw-r--r-- 1 root root 567624 Aug 15 12:20 /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
linux-mint opengl
  • 1 个回答
  • 416 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve