Menu

#990 SMPlayer 21.8.0 fails to build: screensaver.cpp:35:21: error: allocation of incomplete type 'PowerSaving'

smplayer
closed-fixed
nobody
None
5
2021-09-07
2021-09-02
VVD
No
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.

Discussion

  • VVD

    VVD - 2021-09-02

    Testing "DEFINES += Q_OS_LINUX" in src/smplayer.pro.

    Build without errors, 1st test of playback video is good too.

     
  • VVD

    VVD - 2021-09-02

    BTW, lines with sed in file install_appdata.sh are useless.
    And used syntax is not portable.

     
    • Ricardo Villalba

      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.

       
      • VVD

        VVD - 2021-09-04

        smplayer.appdata.xml have lines:

            <releases>
               <!-- <release version="{version}" date="{date}"/> -->
               <release version="21.8.0" date="2021-08-16"/>
               <release version="21.1.0" date="2021-01-06"/>
          </releases>
        

        install_appdata.sh modified commented line only.
        Lines with sed are not needed for build.
        But line with install is needed.

         
        • Ricardo Villalba

          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
          • VVD

            VVD - 2021-09-05

            Correct syntax for FreeBSD is:

            sed -e "s/{version}/`cat version`/" -i '' $1
            sed -e "s/{date}/`date +%Y-%m-%d`/" -i '' $1
            
             
  • VVD

    VVD - 2021-09-03

    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.

     
    • Ricardo Villalba

      I've just replaced all Q_OS_LINUX with OS_UNIX_NOT_MAC (which is defined in smplayer.pro).

       
      • VVD

        VVD - 2021-09-04

        Thanks!
        Will test it now!

        src/youtube/retrieveyoutubeurl.cpp:

        @@ -228,7 +228,7 @@
        
                QString app_bin = absoluteFilePath(ytdlBin());
        
        
        -       #if defined(Q_OS_UNIX) && !defined(Q_OS_MACX)
        +       #ifdef Q_OS_UNIX_NOT_MAC
                QString python_bin = findExecutable("python3");
                if (python_bin.isEmpty()) python_bin = findExecutable("python2");
                if (!python_bin.isEmpty()) {
        
         
        • VVD

          VVD - 2021-09-04

          Version from git build and work fine with commented sed in install_appdata.sh.

           
  • Ricardo Villalba

    • status: open --> closed-fixed
     

Log in to post a comment.