moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
9.83k stars 569 forks source link

Rockchip platform issue,qmake cross Compilation Issues #1067

Closed GeorgeWang12356 closed 11 months ago

GeorgeWang12356 commented 11 months ago

READ ME FIRST! If you're here because something basic is not working (like gamepad input, video, or similar), it's probably something specific to your setup, so make sure you've gone through the Troubleshooting Guide first: https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting

If you still have trouble with basic functionality after following the guide, join our Discord server where there are many other volunteers who can help (or direct you back here if it looks like a Moonlight bug after all). https://moonlight-stream.org/discord

Describe the bug During the process of compiling moonlight qt using qmake cross compilation, SDL related definitions were encountered and could not be found.

sdl2 version : sdl2 2.0.7

Steps to reproduce git clone https://github.com/moonlight-stream/moonlight-qt.git git submodule update --init --recursive qmake moonlight-qt.pro make

Screenshots image

Affected games

Other Moonlight clients

Moonlight settings (please complete the following information)

Gamepad-related issues (please complete if problem is gamepad-related)

Client PC details (please complete the following information)

Server PC details (please complete the following information)

Moonlight Logs (please attach) In file included from /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL_main.h:25, from /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL.h:32, from main.cpp:19: ./streaming/input/input.h:23:43: error: ‘SDL_ControllerSensorEvent’ has not been declared 23 | float lastGyroEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)]; | ^~~~~~~~~ /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL_stdinc.h:93:41: note: in definition of macro ‘SDL_arraysize’ 93 | #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) | ^~~~~ ./streaming/input/input.h:23:43: error: ‘SDL_ControllerSensorEvent’ has not been declared 23 | float lastGyroEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)]; | ^~~~~~~~~ /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL_stdinc.h:93:55: note: in definition of macro ‘SDL_arraysize’ 93 | #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) | ^~~~~ ./streaming/input/input.h:27:44: error: ‘SDL_ControllerSensorEvent’ has not been declared 27 | float lastAccelEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)]; | ^~~~~~~~~ /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL_stdinc.h:93:41: note: in definition of macro ‘SDL_arraysize’ 93 | #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) | ^~~~~ ./streaming/input/input.h:27:44: error: ‘SDL_ControllerSensorEvent’ has not been declared 27 | float lastAccelEventData[SDL_arraysize(SDL_ControllerSensorEvent::data)]; | ^~~~~~~~~ /home/george/workspace/buildroot-rockchip/rk356x/buildroot/output/rockchip_rk3566_cloudneedles/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/SDL2/SDL_stdinc.h:93:55: note: in definition of macro ‘SDL_arraysize’ 93 | #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) | ^~~~~ main.cpp: In function ‘int main(int, char**)’: main.cpp:440:17: error: ‘SDL_HINT_VIDEO_DOUBLE_BUFFER’ was not declared in this scope 440 | SDL_SetHint(SDL_HINT_VIDEO_DOUBLE_BUFFER, "1"); | ^~~~~~~~ Makefile.Release:790: recipe for target 'release/main.o' failed make[2]: *** [release/main.o] Error 1

Additional context

cgutman commented 11 months ago

SDL 2.0.7 is incredibly old (released almost 5 years ago) and we do not support compiling with SDL versions that old.

To use the direct KMSDRM renderer, you will need at least SDL 2.0.16 and kernel 5.8 or later. You can build SDL yourself from source if your platform doesn't have a version new enough. It's quite simple to do that, as we do in our packaging scripts here: https://github.com/cgutman/moonlight-packaging/blob/a8aef4714c5e50ec064031c1f387a5ad90512c7e/scripts/build-deps.sh#L41-L46

The SDL_ControllerSensorEvent issue was an issue with versions of SDL that we do intend to support, so I fixed that in e516943d53612b6dcd22bcb29597f65678ac80aa