I am new to Qt, cross compiling and porting so please bear with me.
My goal is to use the Qwt library on Playbook OS for a Qt based application. I found a nice tutorial on Qt for Blackberry Playbook and I managed to get a simple Qt "Hello World" application running on my tablet.
My next step was to build the Qwt library and make use of it in my application. I spent some time reading about qmake and I built the library along with an application with no problems but when I run the application it crashes as soon I launch it.
Here are the steps that I took in building both the library and my app:
- Downloaded the source for Qwt and used the qmake that comes with the RIM's Qt port. For reference: when installing the Qt port it will create a "stage" directory and the qmake is located here:
~/stage/nto/armle-v7/usr/lib/qt4/bin/qmake
. First I've got an error about the designer plugin, but after turning the designer switch off, it compiled with no errors or warnings. - I have built one of the samples that come with Qwt. I only added on line in the code (based on tutorial instructions):
QCoreApplication::addLibraryPath("app/native/lib");
. This is needed to tell the application where at run time are the shared libraries located on the device. No problems here either. My .pro file looked as follows:
include( $${PWD}/../examples.pri )
TARGET = curvdemo1
DESTDIR = .
QMAKE_LFLAGS += '-Wl,-rpath,\'./app/native/lib\''
LIBS += -lbbsupport
SOURCES = \
curvdemo1.cpp
package.target = $${TARGET}.bar
package.depends = $$TARGET
package.commands = blackberry-nativepackager \
-devMode \
-package $${TARGET}.bar -arg -platform -arg blackberry \
blackberry-tablet.xml $$TARGET \
-e icon.png res/icon.png \
-e splashscreen.png res/splashscreen.png \
-e $$[QT_INSTALL_LIBS]/libQtCore.so.4 lib/libQtCore.so.4 \
-e $$[QT_INSTALL_LIBS]/libQtGui.so.4 lib/libQtGui.so.4 \
-e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.4 lib/libQtOpenGL.so.4 \
-e $$[QT_INSTALL_LIBS]/libQtNetwork.so.4 lib/libQtNetwork.so.4 \
-e $$[QT_INSTALL_LIBS]/libbbsupport.so.4 lib/libbbsupport.so.4 \
-e $$[QT_INSTALL_PLUGINS]/platforms/libblackberry.so lib/platforms/libblackberry.so
-e /home/builder/Qwt/qwt-6.0.1/lib/libqwt.so.6 lib/libqwt.so.6 \
-e /home/builder/Qwt/qwt-6.0.1/lib/libqwtmathml.so.6 lib/libqwtmathml.so.6
QMAKE_EXTRA_TARGETS += package
I packaged the app and deployed it, however when running the application crashes as soon as the splashscreen disappears.
The steps listed above are referring to my attempt of using the Qwt as a shared library. I did try building it as a static library by removing QwtDll
as per library instructions, but the final result is the same. I can tell that the binary makes use of static libs based on its size.
With my little knowledge I can assume that the Qwt library was not properly built and cannot be loaded properly by my test app. If so how to properly port this library to Playbook OS? If not what else am I missing along these steps?
BTW I can't use Momentics to debug for the time being (for other reasons).
Thank you in advance for your contribution to my learning experience.