sapphire-arches / stgl

A very hacked up version of Suckless's ST with an OpenGL renderer
MIT License
27 stars 1 forks source link

Hello, I cant build; non-trivial designated initializers not supported #1

Open japrogramer opened 6 years ago

japrogramer commented 6 years ago

I tried building on an arch linux

> archangel@The_Black_Knight:git/Terminals/stgl  opengl ✔                                                                                                                                                      3h6m  
> ▶ make
> st build options:
> CFLAGS  = -I/usr/X11R6/include  -isystem ./include  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -I/usr/include/libdrm  -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DVERSION="0.7" -D_XOPEN_SOURCE=600 -O
> CXXFLAGS= 
> LDFLAGS = -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXft -ldl  -lfontconfig -lfreetype  -lGL  -lfreetype 
> CC      = c99
> c99 -I/usr/X11R6/include  -isystem ./include  `pkg-config --cflags fontconfig`  `pkg-config --cflags gl`  `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -O -c st.c -o st.o
> c99 -I/usr/X11R6/include  -isystem ./include  `pkg-config --cflags fontconfig`  `pkg-config --cflags gl`  `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -O -c x.c -o x.o
> c99 -I/usr/X11R6/include  -isystem ./include  `pkg-config --cflags fontconfig`  `pkg-config --cflags gl`  `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -O -c src/glad.c -o src/glad.o
> c99 -I/usr/X11R6/include  -isystem ./include  `pkg-config --cflags fontconfig`  `pkg-config --cflags gl`  `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -O -c src/glad_glx.c -o src/glad_glx.o
> g++  -I/usr/X11R6/include  -isystem ./include  `pkg-config --cflags fontconfig`  `pkg-config --cflags gl`  `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -std=c++17 -c rendering.cpp -o rendering.o
> rendering.cpp: In instantiation of ‘void ParticleSystem<Updatefunc>::add_particle(float, float, float, float, float, const color&) [with UpdateFunc = std::function<void(particle&, float)>]’:
> rendering.cpp:1069:115:   required from here
> rendering.cpp:540:12: sorry, unimplemented: non-trivial designated initializers not supported
>    particle np = {
>             ^~
> rendering.cpp:540:12: sorry, unimplemented: non-trivial designated initializers not supported
> make: *** [Makefile:24: rendering.o] Error 1
> 
> archangel@The_Black_Knight:git/Terminals/stgl  opengl ✔                                                                                                                                                     3h7m  ⍉
> ▶ pacman -Ss gcc | ack install
> core/gcc 7.2.0-3 (base-devel) [installed]
> core/gcc-libs 7.2.0-3 (base) [installed]
> community/gcc6 6.4.1-4 [installed]
> community/gcc6-libs 6.4.1-4 [installed]
> multilib/lib32-gcc-libs 7.2.0-3 [installed]
sapphire-arches commented 6 years ago

This is what I get for compiling things with clang by default. If you build with CC=clang CXX=clang++ that should fix the problem for now.

japrogramer commented 6 years ago

Im getting an error .. after building

archangel@The_Black_Knight:git/Terminals/stgl  opengl ✔                                                                                                                                                                                                                                                                                                                                5h47m
▶ ./st
Terminal resized to 24 80
Can't open display

archangel@The_Black_Knight:git/Terminals/stgl  opengl ✔                                                                                                                                                                                                                                                                                                                               5h48m  ⍉
▶ export DISPLAY=:0

archangel@The_Black_Knight:git/Terminals/stgl  opengl ✔                                                                                                                                                                                                                                                                                                                                5h48m
▶ ./st
Terminal resized to 24 80
OpenGL 4.5.0 NVIDIA 387.22, GLSL 4.50 NVIDIA
Make vertex shader
Make fragment shader
Creating frame buffer of size 1 1
GL_INVALID_ENUM error in glTextureStorage2D
[1]    25365 abort (core dumped)  ./st

do I need to pass this flag to startx ? startx -- +iglx

japrogramer commented 6 years ago

I tried startx -- +iglx and it doesn't help.

sapphire-arches commented 6 years ago

You'll need to pull the latest code. I pulled in another library for vector math (glm) and got rid of the initializer list error so you should be able to build with GCC. There was another bug (the one you're running in to now) which /u/flesh_flute on reddit helped me track down.

japrogramer commented 6 years ago

ok I installed the glm library and was able to build; but know i ran into what appears to be a bug in its behavior .. whenever it starts to draw particles, whenever i stop typing the particles stop .. they are no longer animated. The particles shown here will remain until I continued typing and will slowly move with every key press screen_2017-11-21-23-40-17

Is the only warning i get, probably not related Warning: too many elements, not adding to buffer

sapphire-arches commented 6 years ago

That's very strange. Can you build with make clean && CFLAGS=-ggdb3 CXXFLAGS=-ggdb3 make, run under gdb, press control-c in the GDB window when the particles are frozen, and provide the output of the bt command? I'd like to know where it's getting stuck, since it should just be running in an infinite loop, locked to V-Sync.

japrogramer commented 6 years ago

Here is the output

git/Terminals/stgl  opengl ✔
▶ gdb ./st
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./st...done.
(gdb) n
The program is not being run.
(gdb) st
Ambiguous command "st": stack, start, status, step, stepi, stepping, stop, strace.
(gdb) run
Starting program: /home/archangel/git/Terminals/stgl/st
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Terminal resized to 24 80
OpenGL 4.5.0 NVIDIA 387.22, GLSL 4.50 NVIDIA
Make vertex shader
Make fragment shader
Creating frame buffer of size 1 1
Creating frame buffer of size 1 1
Make vertex shader
Make fragment shader
Make vertex shader
Make fragment shader
Make vertex shader
Make fragment shader
Make vertex shader
Make fragment shader
Render resize to 2371 2128
Creating frame buffer of size 2371 2128
Creating frame buffer of size 790 709
Total matches: 1
mononoki /usr/share/fonts/ttf-mononoki/mononoki-Bold.ttf
ascent: 16 descent: -3 rbearing: 11 height: 21 width: 11
Total matches: 1
mononoki /usr/share/fonts/ttf-mononoki/mononoki-BoldItalic.ttf
ascent: 16 descent: -3 rbearing: 11 height: 21 width: 11
Total matches: 1
mononoki /usr/share/fonts/ttf-mononoki/mononoki-BoldItalic.ttf
ascent: 16 descent: -3 rbearing: 11 height: 21 width: 11
Total matches: 1
mononoki /usr/share/fonts/ttf-mononoki/mononoki-Bold.ttf
ascent: 16 descent: -3 rbearing: 11 height: 21 width: 11
Terminal resized to 101 215
erresc: unknown str ESC]10
erresc: unknown str ESC]11
erresc: unknown str ESC]12
^C
Program received signal SIGINT, Interrupt.
0x00007ffff5f29e69 in pselect () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff5f29e69 in pselect () from /usr/lib/libc.so.6
#1  0x00005555555770d1 in run () at x.c:1717
#2  0x0000555555577d23 in main (argc=0, argv=0x7fffffffe4e0) at x.c:1854
(gdb)

screen_2017-11-22-11-30-33