nowrep / obs-vkcapture

OBS Linux Vulkan/OpenGL game capture
GNU General Public License v2.0
508 stars 25 forks source link

Build fails on Debian Sid #150

Closed physixcat closed 1 year ago

physixcat commented 1 year ago

I have the listed dependencies installed, and I followed the build instructions, but make is interrupted by the following

[  6%] Generating screencopy_unstable_v1.h
[ 13%] Generating screencopy_unstable_v1.c
[ 20%] Building C object CMakeFiles/linux-vkcapture.dir/src/vkcapture.c.o
/home/physixcat/obs-vkcapture/src/vkcapture.c:22:10: fatal error: obs-nix-platform.h: No such file or directory
   22 | #include <obs-nix-platform.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/linux-vkcapture.dir/build.make:84: CMakeFiles/linux-vkcapture.dir/src/vkcapture.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/linux-vkcapture.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The file it is looking for, obs-nix-platform.h, is indeed present in /usr/include/obs If I soft link it to the build directory, then I get the next error

[  6%] Building C object CMakeFiles/linux-vkcapture.dir/src/vkcapture.c.o
In file included from /home/physixcat/obs-vkcapture/src/vkcapture.c:22:
/home/physixcat/obs-vkcapture/build/obs-nix-platform.h:27:34: error: expected ‘,’ or ‘}’ before ‘OBS_DEPRECATED’
   27 |         OBS_NIX_PLATFORM_X11_GLX OBS_DEPRECATED,
      |                                  ^~~~~~~~~~~~~~
/home/physixcat/obs-vkcapture/src/vkcapture.c: In function ‘cursor_create’:
/home/physixcat/obs-vkcapture/src/vkcapture.c:132:35: error: ‘OBS_NIX_PLATFORM_X11_EGL’ undeclared (first use in this function); did you mean ‘OBS_NIX_PLATFORM_X11_GLX’?
  132 |     if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_EGL) {
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                   OBS_NIX_PLATFORM_X11_GLX
/home/physixcat/obs-vkcapture/src/vkcapture.c:132:35: note: each undeclared identifier is reported only once for each function it appears in
/home/physixcat/obs-vkcapture/src/vkcapture.c:145:35: error: ‘OBS_NIX_PLATFORM_WAYLAND’ undeclared (first use in this function); did you mean ‘OBS_NIX_PLATFORM_X11_GLX’?
  145 |     if (obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND) {
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                   OBS_NIX_PLATFORM_X11_GLX
/home/physixcat/obs-vkcapture/src/vkcapture.c: In function ‘vkcapture_source_video_tick’:
/home/physixcat/obs-vkcapture/src/vkcapture.c:476:32: warning: implicit declaration of function ‘gs_texture_create_from_dmabuf’; did you mean ‘gs_texture_create_from_file’? [-Wimplicit-function-declaration]
  476 |                 ctx->texture = gs_texture_create_from_dmabuf(ctx->tdata.width, ctx->tdata.height,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                gs_texture_create_from_file
/home/physixcat/obs-vkcapture/src/vkcapture.c:476:30: warning: assignment to ‘gs_texture_t *’ {aka ‘struct gs_texture *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  476 |                 ctx->texture = gs_texture_create_from_dmabuf(ctx->tdata.width, ctx->tdata.height,
      |                              ^
/home/physixcat/obs-vkcapture/src/vkcapture.c: In function ‘obs_module_load’:
/home/physixcat/obs-vkcapture/src/vkcapture.c:897:21: error: ‘OBS_NIX_PLATFORM_X11_EGL’ undeclared (first use in this function); did you mean ‘OBS_NIX_PLATFORM_X11_GLX’?
  897 |     if (platform != OBS_NIX_PLATFORM_X11_EGL && platform != OBS_NIX_PLATFORM_WAYLAND) {
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
      |                     OBS_NIX_PLATFORM_X11_GLX
/home/physixcat/obs-vkcapture/src/vkcapture.c:897:61: error: ‘OBS_NIX_PLATFORM_WAYLAND’ undeclared (first use in this function); did you mean ‘OBS_NIX_PLATFORM_X11_GLX’?
  897 |     if (platform != OBS_NIX_PLATFORM_X11_EGL && platform != OBS_NIX_PLATFORM_WAYLAND) {
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             OBS_NIX_PLATFORM_X11_GLX
make[2]: *** [CMakeFiles/linux-vkcapture.dir/build.make:84: CMakeFiles/linux-vkcapture.dir/src/vkcapture.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/linux-vkcapture.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

What am I doing wrong?

nowrep commented 1 year ago

Please post full build log and verbose make/ninja (ninja -v make VERBOSE=1).

physixcat commented 1 year ago

Sure, here are stdout and stderr before making the symlink to /usr/include/obs/obs-nix-platform.h

I know I showed stderr already but I was using -j12 in those, so there were some unrelated messages from parallelization

beforesymlink_stdout.txt beforesymlink_stderr.txt

And after making the symlink to /usr/include/obs/obs-nix-platform.h aftersymlink_stdout.txt aftersymlink_stderr.txt

nowrep commented 1 year ago

It's not using your system-wide OBS installation: -isystem /home/physixcat/strider_script/source/obs-studio/libobs Please post output of the cmake command too.

physixcat commented 1 year ago

Oh damn that's right, that's such an old script too. I think what might have happened was the terminal I was running the commands from was open before reinstalling obs from another terminal window? So it didn't pick up the system-wide path because it wasn't installed when it was open?

Here is the output of cmake cmakelog.txt And the now working output of make, without needing to symlink anything makelog.txt

I'm not sure what it was, but it's fixed now from just doing it on a fresh terminal. Thank you!