Integrate custom lib
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!
Out of curiosity, why can't you use that library ?
Why not build that library yourself and then link to it in your project ?
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?
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?
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.