matanui159 / ReplaySorcery

An open-source, instant-replay solution for Linux
GNU General Public License v3.0
851 stars 26 forks source link

Compile failed on Mint 20.2 #133

Closed caecilliusinhorto closed 2 years ago

caecilliusinhorto commented 2 years ago

Describe the bug Compile failed on Mint 20.2. This is the same issue as #130 , but installing xcb dev libraries didn't do anything.

In file included from /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:20: /home/delta/Desktop/ReplaySorcery/src/device/x11dev.h:43:44: error: unknown type name ‘uint32_t’ 43 | int rsXClientGetKeyCode(RSXClient client, uint32_t sym); | ^~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c: In function ‘xclientError’: /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:27:9: error: ‘XCB_CONN_ERROR’ undeclared (first use in this function) 27 | case XCB_CONN_ERROR: | ^~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:27:9: note: each undeclared identifier is reported only once for each function it appears in /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:29:9: error: ‘XCB_CONN_CLOSED_EXT_NOTSUPPORTED’ undeclared (first use in this function) 29 | case XCB_CONN_CLOSED_EXT_NOTSUPPORTED: | ^~~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:31:9: error: ‘XCB_CONN_CLOSED_MEM_INSUFFICIENT’ undeclared (first use in this function) 31 | case XCB_CONN_CLOSED_MEM_INSUFFICIENT: | ^~~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:33:9: error: ‘XCB_CONN_CLOSED_REQ_LEN_EXCEED’ undeclared (first use in this function) 33 | case XCB_CONN_CLOSED_REQ_LEN_EXCEED: | ^~~~~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:35:9: error: ‘XCB_CONN_CLOSED_PARSE_ERR’ undeclared (first use in this function) 35 | case XCB_CONN_CLOSED_PARSE_ERR: | ^~~~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:37:9: error: ‘XCB_CONN_CLOSED_INVALID_SCREEN’ undeclared (first use in this function) 37 | case XCB_CONN_CLOSED_INVALID_SCREEN: | ^~~~~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c: At top level: /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:101:5: warning: no previous prototype for ‘rsXClientGetKeyCode’ [-Wmissing-prototypes] 101 | int rsXClientGetKeyCode(RSXClient client, uint32_t sym) { | ^~~~~~~ /home/delta/Desktop/ReplaySorcery/src/device/x11dev.c:25:12: warning: ‘xclientError’ defined but not used [-Wunused-function] 25 | static int xclientError(int error) { | ^~~~ make[2]: [CMakeFiles/replay-sorcery.dir/build.make:401: CMakeFiles/replay-sorcery.dir/src/device/x11dev.c.o] Error 1 make[2]: Leaving directory '/home/delta/Desktop/ReplaySorcery/bin' make[1]: [CMakeFiles/Makefile2:133: CMakeFiles/replay-sorcery.dir/all] Error 2 make[1]: Leaving directory '/home/delta/Desktop/ReplaySorcery/bin' make: *** [Makefile:130: all] Error 2 make: Leaving directory '/home/delta/Desktop/ReplaySorcery/bin'

Jourdelune commented 2 years ago

same error

matanui159 commented 2 years ago

Honestly I kind of regret switching to XCB. The library is leagues better than X11 but so many people are having trouble installing it and I don't know why. Can you check what the CMake logs say? Maybe it will give more info as to why it can't find XCB

Jourdelune commented 2 years ago
make : on entre dans le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[1] : on entre dans le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[2] : on entre dans le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[2] : on quitte le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
[ 18%] Built target backtrace
make[2] : on entre dans le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[2] : on quitte le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[2] : on entre dans le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
[ 20%] Building C object CMakeFiles/replay-sorcery.dir/src/device/x11dev.c.o
In file included from /home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:20:
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.h:43:44: error: unknown type name ‘uint32_t’
   43 | int rsXClientGetKeyCode(RSXClient *client, uint32_t sym);
      |                                            ^~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c: In function ‘xclientError’:
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:27:9: error: ‘XCB_CONN_ERROR’ undeclared (first use in this function)
   27 |    case XCB_CONN_ERROR:
      |         ^~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:27:9: note: each undeclared identifier is reported only once for each function it appears in
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:29:9: error: ‘XCB_CONN_CLOSED_EXT_NOTSUPPORTED’ undeclared (first use in this function)
   29 |    case XCB_CONN_CLOSED_EXT_NOTSUPPORTED:
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:31:9: error: ‘XCB_CONN_CLOSED_MEM_INSUFFICIENT’ undeclared (first use in this function)
   31 |    case XCB_CONN_CLOSED_MEM_INSUFFICIENT:
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:33:9: error: ‘XCB_CONN_CLOSED_REQ_LEN_EXCEED’ undeclared (first use in this function)
   33 |    case XCB_CONN_CLOSED_REQ_LEN_EXCEED:
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:35:9: error: ‘XCB_CONN_CLOSED_PARSE_ERR’ undeclared (first use in this function)
   35 |    case XCB_CONN_CLOSED_PARSE_ERR:
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:37:9: error: ‘XCB_CONN_CLOSED_INVALID_SCREEN’ undeclared (first use in this function)
   37 |    case XCB_CONN_CLOSED_INVALID_SCREEN:
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c: At top level:
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:101:5: warning: no previous prototype for ‘rsXClientGetKeyCode’ [-Wmissing-prototypes]
  101 | int rsXClientGetKeyCode(RSXClient *client, uint32_t sym) {
      |     ^~~~~~~~~~~~~~~~~~~
/home/jourdelune/Téléchargements/ReplaySorcery/src/device/x11dev.c:25:12: warning: ‘xclientError’ defined but not used [-Wunused-function]
   25 | static int xclientError(int error) {
      |            ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/replay-sorcery.dir/build.make:401 : CMakeFiles/replay-sorcery.dir/src/device/x11dev.c.o] Erreur 1
make[2] : on quitte le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make[1]: *** [CMakeFiles/Makefile2:133 : CMakeFiles/replay-sorcery.dir/all] Erreur 2
make[1] : on quitte le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »
make: *** [Makefile:130 : all] Erreur 2
make : on quitte le répertoire « /home/jourdelune/Téléchargements/ReplaySorcery/bin »

My output when I try yo compile, and for cmake output: CMakeError.log CMakeOutput.log

drogeek commented 2 years ago

I got exactly the same error, using Ubuntu 20.04.3 LTS

Jiternos commented 2 years ago

I'm still experiencing this, using Ubuntu 20.04.3 LTS The Error Logs are similiar too

drogeek commented 2 years ago

but that's weird, where are those xcb variable defined and imported? I don't see any mention of those.

when I compile the CMakeLists.txt I get

~/D/ReplaySorcery ❯❯❯ cmake -B bin -DCMAKE_BUILD_TYPE=Release                                                                                                                                           master ✱ ◼
-- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB) 
-- Checking for module 'libpulse'
--   No package 'libpulse' found
-- Checking for module 'libdrm'
--   No package 'libdrm' found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/toor/Documents/ReplaySorcery/bin

Seems to be the problem

UPDATE: running sudo apt install libx11-xcb-dev fixed the missing X11, but still the macros are not defined, it seems like it's not linked

177 # X11
178 find_package(X11)
179 if (X11_FOUND AND X11_xcb_FOUND)
180    set(RS_BUILD_X11_FOUND ON)
181    target_include_directories(${binary} SYSTEM PRIVATE ${X11_INCLUDE_DIRS} ${X11_xcb_INCLUDE_PATH})
182    target_link_libraries(${binary} PRIVATE ${X11_LIBRARIES} ${X11_xcb_LIB})
183 endif()

seems to be this part in the CMakeLists.txt that including the xcb variables. I tried to debug using message for the value of X11_xcb_FOUND and X11_xcb_INCLUDE_PATH, they are both empty.

matanui159 commented 2 years ago

They should be defined by find_packet(X11), see: https://cmake.org/cmake/help/latest/module/FindX11.html

Make sure your cmake is at least 3.18

drogeek commented 2 years ago

They should be defined by find_packet(X11), see: https://cmake.org/cmake/help/latest/module/FindX11.html

Make sure your cmake is at least 3.18

Updating cmake > 3.18 fixed this particular error, now I'm getting a link error

matanui159 commented 2 years ago

What is the link error?

caecilliusinhorto commented 2 years ago

I updated cmake and it fixed the compile error