Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Integrate custom lib
Qt 6.11 is out! See what's new in the release blog

Integrate custom lib

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SikarjanS Offline
    SikarjanS Offline
    Sikarjan
    wrote on last edited by
    #1

    Hi,

    I am working on an app for Sailfish OS. I need to prevent the system from going into sleep. Otherwise my timer will not work properly and with it my app.

    Unfortunately I am not allowed to use the build in libkeepalive library. I need to "build in" this library in my app but I have no idea on how to do that. Currently I am in desperate need of these things:

    • Which files should I get from this repository?
    • Where should I put the files in my project (need I to compile something first or can I use them directly)?
    • How do I make the component KeepAlive available in my app?

    my current source code can be found on github, in case that helps to answer my questions.

    I would be grateful for any hints in the right direction!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Out of curiosity, why can't you use that library ?

      Why not build that library yourself and then link to it in your project ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • SikarjanS Offline
        SikarjanS Offline
        Sikarjan
        wrote on last edited by
        #3

        Hi,

        the harbour rules only allow a couple of libs, the others are not "stable" enough, yet and libkeepalive is not on their list. So my app got turned down by QA.

        I have not build the library my self because I have not done such a thing before. I have been trying to read up on it but the examples I read were not for Sailfish OS.
        To build it my self I only need to open the .pro file from the lib folder and run build? On the machine I tried it on that failed because libiphb development package not found but I do not have the Sailfish SDK installed on this one.
        I guess I need to configure the project for arm. Anything else I need to keep in mind?

        1 Reply Last reply
        0
        • SikarjanS Offline
          SikarjanS Offline
          Sikarjan
          wrote on last edited by
          #4

          Hi again

          So I compiled the pro file from the plugin folder against arm7 and got an libkeepaliveplugin.so file. That is the one I need, right?
          I copied the file in my project under plugins/. To include it I added these lines to my pro file

          INCLUDEPATH += plugins/
          LIBS += -L plugins/ -lkeepaliveplugin
          

          and in my QML file I tried

          #import Nemo.KeepAlive 1.1
          

          but the IDE tells me that it could not find that and when I try to compile I get the error:

          /opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: cannot find -lkeepaliveplugin
          

          What am I doing wrong here?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            You usually don't link against a plugin, you use it at run time.

            In any case, you should contact the SailfishOS folks about that matter.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved