Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
BlackBerry Development Advisor (Retired)
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to port your Qt-Projects to Playbook!

So, was the error message about -platform or QMAKESPEC pertinent or spurious?

Have you made any progress?

 

Thanks all for this excellent thread.

 

There is a pool of people here who have worked on Qt apps on playbook.  This thread is all about getting the instructions clear.   Are you trying to get a simple hello world program working and debuggable?  If not and you're still having trouble, can you simplify and re-test the steps.  Hopefully this will zero in on where we need clearer instructions.

 

Stuart

Developer
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: How to port your Qt-Projects to Playbook!

[ Edited ]

bskania, it's almost impossible to compile Qt libs on windows 7, neither for armv7le nor x86.
Only solution is: download Qt SDK from BlackBerry github, sniff around native forums, there are compiled x86 libs (don't remember who provided them) and exchange lib folder. Nothing more.

Also, here are latest 4.8.2 release and debug libs (armv7le only) from Jon
https://www.dropbox.com/sh/xv30g36jd37krqi/rf3n8qHaSP

 

 

EDIT:

 

Here is x86 libs (althought a bit older)

Just exchange libs folder that is located at C:\QtPlaybookSDK\Playbook\Qt\4.8.1

http://microcode.ca/downloads/qt4.8-stage-playbook-x86-qcc.tgz

BlackBerry Development Advisor (Retired)
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to port your Qt-Projects to Playbook!

1. If this thead is clearer or more complete than existing documentation and knowledge base (KB) articles, perhaps you would like to start a KB article from this thread.

http://supportforums.blackberry.com/t5/BlackBerry-App-World-Development/How-to-create-your-own-artic...

 

2. Are all questions on how to port your Qt projects sufficiently answered now?  Or are some steps still unclear?

 

3. If you still have specific questions not directly related to the thread subject, please start a new thread.

 

Stuart

Developer
Posts: 105
Registered: ‎04-24-2012
My Device: blackberry developer
My Carrier: relience

Re: How to port your Qt-Projects to Playbook!

The x86 lib is not supported. Its of windows xp service pack 2.
When I try to use the qmake it says not proper file. qmake.exe is not executable.
New Developer
Posts: 14
Registered: ‎07-17-2012
My Device: 8900 and playbook
My Carrier: CHINA MOBILE

Re: How to port your Qt-Projects to Playbook!

hello, I have a question.

 

I have run my app successfully, but when I install the app to other playbook without debugtoken, it will show "have no debugtoken", so, how can I deploy my app with Qt creator?? thank for you answer.

Contributor
Posts: 15
Registered: ‎11-28-2012
My Device: none
My Carrier: none

Re: How to port your Qt-Projects to Playbook!

[ Edited ]

I'm a little new to c++ and compiling a lot of code coming from a java background so I might be overlooking the obvious here but I have a few questions.

 

I tried following this blog : http://qt-project.org/wiki/Building-Qt4-for-BlackBerry

 

I set my env variables by calling : source ~/bbndk-2.1.0/bbndk-env.sh

*my bbndk is located in my home folder*

I clone the git repository (git clone git://gitorious.org/qt/qt.git)

since this is a playbook build I then go to the qt directory checkout version 4.8.3 (git checkout v4.8.3)

Calling this command

" ./configure -opensource -confirm-license -qpa -iconv -shared -release -xplatform blackberry-armv7le-qcc \     -little-endian -arch arm -largefile -nomake examples -xmlpatterns -no-webkit -no-rpath     -opengl es2 -reduce-exports -system-sqlite -prefix /home/myname/qtCompiled "

 

invalid argument, I poked around a bit and saw that if i removed the "\" after blackberry-armv7le-qcc it will continue but then after the configure step.

 

When I call make, i get an error stating cannot create global header file error 127. I haven't figured out a way to get past that error and I am not really sure what's going on.

 

Can anyone lay out some steps as to get qt compiled for blackberry playbook?

 

I wanted to get qt setup on my system, so I followed this blog : http://webcache.googleusercontent.com/search?q=cache:i7YRHClrkUYJ:rapidberry.net/setting-up-qt-creat...

 

I get right to the part where I need to set my qt version and it all

 

I've even tried going to the blackberry qt github page : https://github.com/blackberry/Qt/downloads

I download the linux installer but it doesn't run. The file is showing up on my system and an executable but I can't run it with ./nameofdownload, even after a chmod +x 

Do I need to do something special to run that file?

New Contributor
Posts: 8
Registered: ‎04-14-2012
My Device: Playbook
My Carrier: O2

Re: How to port your Qt-Projects to Playbook!

Hello all,

 

I'm back, and I see that developing for the Playbook is still as daunting as when I gave up last year! This time I have come armed with extra determination!

 

After 2 days wasted ("wasted" is subjective, I've learnt how to use Git, how to not be able to compile the Qt source under windows following this guide: http://qt-project.org/wiki/Building-Qt4-for-BlackBerry and various other "fun" things) I discovered this thread and have managed to install the Qt-4_8_0-PlaybookSDK.exe from the link in BikeAtor's first post.

 

Using a combination of this thread and Jon's thread I have managed to achieve not too much! I have added the extra steps in the "Build Steps" to sign and deploy, but when I look in my project folder, there is no "<proj_name>.bar" file being produced?! I have amended the ".pro" file as described here: http://qt-project.org/wiki/Deploy_Qt4_based_app_to_BB_PB_usingQtCreator and now my file looks like this:

 

TEMPLATE = app

QT += declarative

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp

OTHER_FILES += bar-descriptor.xml \
    qml/main.qml

package.target = $${TARGET}.bar
package.depends = $$TARGET
package.commands = blackberry-nativepackager \
    -devMode -debugToken C:\Users\Pete\BBtest\debugtoken1.bar \
    -package $${TARGET}.bar -arg -platform -arg blackberry \
    bar-descriptor.xml $$TARGET \
    -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_PLUGINS]/platforms/libblackberry.so plugins/platforms/libblackberry.so

 I have changed nothing in the "bar-descriptor.xml" file (maybe this is my mistake?) So it contains the default data that is included when you create a new BB project (which I assumed should work, given that the new project already contains some kind of "Hello World" code). My "bar-descriptor.xml" looks like this:

 

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
    <id>ID</id>
    <name>BBtest</name>
    <versionNumber>1.0.0</versionNumber>
    <description>DESCRIPTION</description>

    <initialWindow>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
        <autoOrients>true</autoOrients>
        <aspectRatio>landscape</aspectRatio>
    </initialWindow>

    <env var="QML_IMPORT_PATH" value="app/native/imports"/>
    <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
    <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
    <arg>-platform</arg>
    <arg>blackberry</arg>

    <action system="true">run_native</action>
    <asset entry="true" path="BBtest" type="Qnx/Elf">BBtest</asset>

    <asset path="splashscreen.png">splashscreen.png</asset>
    <asset path="icon.png">icon.png</asset>
    <asset path="qml">qml</asset>

    <!-- These values will be replaced when deploying in Qt Creator -->
    <asset path="%QT_INSTALL_LIBS%">lib</asset>
    <asset path="%QT_INSTALL_PLUGINS%">plugins</asset>
    <asset path="%QT_INSTALL_IMPORTS%">imports</asset>

    <icon><image>icon.png</image></icon>
    <splashscreen>splashscreen.png</splashscreen>
</qnx>

 So I build the project, and my output looks like this:

 

18:59:57: Running steps for project BBtest...
18:59:57: Configuration unchanged, skipping qmake step.
18:59:57: Starting: "C:\bbndk-2.0.0\host\win32\x86\usr\bin\make.exe" -w
make.exe: Entering directory `C:/Users/Pete/BBtest'
qcc -Vgcc_ntoarmv7le -lang-c++ -c -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/mkspecs/default -I. -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtCore -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtGui -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtDeclarative -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include -I. -I../../../bbndk-2.0.0/target/qnx6/usr/include -I../../../bbndk-2.0.0/target/qnx6/usr/include/freetype2 -o main.o main.cpp
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,C:/bbndk-2.0.0/target/qnx6/armle-v7/lib -Wl,-rpath-link,C:/bbndk-2.0.0/target/qnx6/armle-v7/usr/lib -Wl,-O1 -o BBtest main.o    -LC:/bbndk-2.0.0/target/qnx6/armle-v7/lib -LC:/bbndk-2.0.0/target/qnx6/armle-v7/usr/lib -LC:\QtPlaybookSDK\Playbook\Qt\4.8.1\lib -lQtDeclarative -L/home/andy/playbook/qt/stage/Playbook/Qt/4.8.1/lib -L/opt/bbndk-2.0.0-beta2/target/qnx6/armle-v7/lib -L/opt/bbndk-2.0.0-beta2/target/qnx6/armle-v7/usr/lib -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtNetwork -lsocket -lQtGui -lQtCore -lm 
make.exe: Leaving directory `C:/Users/Pete/BBtest'
18:59:59: The process "C:\bbndk-2.0.0\host\win32\x86\usr\bin\make.exe" exited normally.
18:59:59: Starting: "D:\BlackBerry Development SDK\APK Repackager\blackberry.tools.SDK\bin\batchbar-signer.bat" C:\Users\Pete\BBtest\BBtest D:\BlackBerry Development SDK\keys\author.p12 <password_removed>
Invalid certificate file.

The batch file is complete.
18:59:59: The process "D:\BlackBerry Development SDK\APK Repackager\blackberry.tools.SDK\bin\batchbar-signer.bat" exited normally.
18:59:59: Starting: "D:\BlackBerry Development SDK\APK Repackager\blackberry.tools.SDK\bin\blackberry-deploy.bat" -installApp -device 192.168.1.72 -package C:\Users\Pete\BBtest\BBtest.bar -password <password_removed>
Error: File does not exist or not a file or cannot read: C:\Users\Pete\BBtest\BBtest.bar 
19:00:00: The process "D:\BlackBerry Development SDK\APK Repackager\blackberry.tools.SDK\bin\blackberry-deploy.bat" exited with code 1.
Error while building/deploying project BBtest (target: QNX Arm)
When executing step 'Custom Process Step'

 And in fact, just reading through that output properly, I think I can see (at least part of) the problem - I guess this doesn't help:

 

 -L/home/andy/playbook/qt/stage/Playbook/Qt/4.8.1/lib

 

Does anybody know how/where the linking is set up in Qt Developer? I think this may be a remnant from my "debugging" yesterday (i.e. I was tired of reading so much and started randomly cutting and pasting from web pages before going to bed! :Oops:)

 

Any help would be gratefully received!

 

Pete

New Contributor
Posts: 8
Registered: ‎04-14-2012
My Device: Playbook
My Carrier: O2

Re: How to port your Qt-Projects to Playbook!

Okay, so I figured out the problem with the signing side of things. I was missing the CSK password (which although it appears optional here:http://developer.blackberry.com/android/documentation/signing_multiple_apps_1727943_11.html it was not optional for me) and I did not consider the whitespace in the path to the signing key. Changing:

C:\Users\Pete\BBtest\ D:\Users\Pete\AppData\Local\Research In Motion\author.p12 <keystore_password>

to...

C:\Users\Pete\BBtest\ "D:\Users\Pete\AppData\Local\Research In Motion\author.p12" <keystore_password> <csk_password>

fixed the signing issue. So, a couple of "schoolboy errors" there... :smileyembarrassed:

 

However, it doesn't help me much because qmake does not produce a ".bar" file for me to sign! The output from the compiler when I build the "Hello World" project (with signing and deploying disabled) is:

15:18:03: Running steps for project BBtest...
15:18:03: Configuration unchanged, skipping qmake step.
15:18:03: Starting: "C:\bbndk-2.0.0\host\win32\x86\usr\bin\make.exe" -w
make.exe: Entering directory `C:/Users/Pete/BBtest'
qcc -Vgcc_ntoarmv7le -lang-c++ -c -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/mkspecs/default -I. -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtCore -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtGui -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include/QtDeclarative -I../../../QtPlaybookSDK/Playbook/Qt/4.8.1/include -I. -I../../../bbndk-2.0.0/target/qnx6/usr/include -I../../../bbndk-2.0.0/target/qnx6/usr/include/freetype2 -o main.o main.cpp
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,C:/bbndk-2.0.0/target/qnx6/armle-v7/lib -Wl,-rpath-link,C:/bbndk-2.0.0/target/qnx6/armle-v7/usr/lib -Wl,-O1 -o BBtest main.o    -LC:/bbndk-2.0.0/target/qnx6/armle-v7/lib -LC:/bbndk-2.0.0/target/qnx6/armle-v7/usr/lib -LC:\QtPlaybookSDK\Playbook\Qt\4.8.1\lib -lQtDeclarative -L/home/andy/playbook/qt/stage/Playbook/Qt/4.8.1/lib -L/opt/bbndk-2.0.0-beta2/target/qnx6/armle-v7/lib -L/opt/bbndk-2.0.0-beta2/target/qnx6/armle-v7/usr/lib -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtNetwork -lsocket -lQtGui -lQtCore -lm 
make.exe: Leaving directory `C:/Users/Pete/BBtest'
15:18:05: The process "C:\bbndk-2.0.0\host\win32\x86\usr\bin\make.exe" exited normally.
15:18:05: Skipping disabled step Custom Process Step.
15:18:05: Skipping disabled step Custom Process Step.

I guess the most interesting part here is the linking phase, where the output is defined simply as:

... -o BBtest main.o ...

So my final executable is "BBtest". What I can't figure out is how to change my final output to a "bar" file? I tried renaming this file to "BBtest.bar" as a test, and it cannot be opened by the signing tool. This leads me to think that there must be something missing in my build process, but what?

 

As an aside, are most people here "cheating" and using VirtualBox/Linux combinations on Windows? I admit that I could easily do this, but it is bugging me that other people seem to be able to work with the Windows tools and this makes me determined to find out why I cannot! It may also help other budding BB developers if they have the same troubles as me - though by the time I figure this out, the Playbook may be running BB10 or just be obsolete! :smileylol: