SMPlayer 21.8.0 fails to build: screensaver.cpp:35:21: error: allocation of...
Free media player with support for Youtube
Brought to you by:
rvm
screensaver.cpp:35:21: error: allocation of incomplete type 'PowerSaving'
power_saving = new PowerSaving(this);
^~~~~~~~~~~
./screensaver.h:24:7: note: forward declaration of 'PowerSaving'
class PowerSaving;
^
screensaver.cpp:49:14: error: member access into incomplete type 'PowerSaving'
power_saving->uninhibit();
^
./screensaver.h:24:7: note: forward declaration of 'PowerSaving'
class PowerSaving;
^
screensaver.cpp:57:14: error: member access into incomplete type 'PowerSaving'
power_saving->inhibit();
^
./screensaver.h:24:7: note: forward declaration of 'PowerSaving'
class PowerSaving;
This hack fixed build:
--- src/screensaver.cpp.orig
+++ src/screensaver.cpp
@@ -21,7 +21,7 @@
#ifdef Q_OS_WIN
#include "winscreensaver.h"
#endif
-#ifdef Q_OS_LINUX
+#ifdef Q_OS_UNIX
#include "powersaving.h"
#endif
#ifdef Q_OS_MACX
Host: FreeBSD 12.2 amd64.
Testing "DEFINES += Q_OS_LINUX" in src/smplayer.pro.
Build without errors, 1st test of playback video is good too.
BTW, lines with sed in file install_appdata.sh are useless.
And used syntax is not portable.
The sed commands replace" {version}" and "{date}" in smplayer.appdata.xml with actual data. That info is used when building the snap and flatpak packages.
smplayer.appdata.xml have lines:
install_appdata.sh modified commented line only.
Lines with sed are not needed for build.
But line with install is needed.
Yes, the line is commented in version 21.8 but not on the development version.
I've just fixed the sed lines, now they should work fine on freebsd.
Last edit: Ricardo Villalba 2021-09-05
Correct syntax for FreeBSD is:
I think it's fixed now.
https://github.com/smplayer-dev/smplayer/commit/facc9c2ed017fcf82f85ff1f1b1fa9369c4e0c6c
Thanks.
What about other Q_OS_LINUX?
Maybe add same changes with Q_OS_FREEBSD near every Q_OS_LINUX?
Build and work fine for me.
I've just replaced all Q_OS_LINUX with OS_UNIX_NOT_MAC (which is defined in smplayer.pro).
Thanks!
Will test it now!
src/youtube/retrieveyoutubeurl.cpp:
Version from git build and work fine with commented sed in install_appdata.sh.