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
New Contributor
Posts: 7
Registered: ‎04-13-2012
My Device: playbook
My Carrier: MTS
Accepted Solution

QT application trouble with compile

Hi folks,

 

In general palybook is a nice tab, my wife a QA test lead on our company and she is like to test the new app and hardware, but after 1,5 hours of searching,watching and testing android player is hangs Smiley Happy WOW... real QA. Smiley Happy QNX working fine.

 

But, I am a developer and I have a strange trouble with QT env for playbook simulator.

I using http://wiki.qt-project.org/QNX manual for build qt env for qnx.

All compiling fine and installed to the prefix directory as well.

 

Then I prepare the "Hello world" simple program for testing if all can build successfully.

My system is gentoo with kernel 3.2.12

my project compile like:

/home/miha/playbook_simulator_2_0/qt/x86/bin/qmake -project

which qcc
/home/miha/playbook_simulator_2_0/bbndk-2.0/host/linux/x86/usr/bin/qcc

which make
/home/miha/playbook_simulator_2_0/bbndk-2.0/host/linux/x86/usr/bin/make

 qcc string

qcc -Vgcc_ntox86 -c -fstack-protector -fstack-protector-all -Wno-psabi -O2 -Wall -W 
-D_REENTRANT
-DQ_OS_BLACKBERRY
-DQT_NO_DEBUG
-DQT_GUI_LIB
-DQT_CORE_LIB
-DQT_SHARED
-I../../x86/mkspecs/unsupported/blackberry-x86-qcc -I.
-I../../x86/include/QtCore
-I../../x86/include/QtGui
-I../../x86/include -I. -I.
-I../../../bbndk-2.0/target/qnx6/usr/include
-I../../../bbndk-2.0/target/qnx6/usr/include/freetype2
-o main.o main.c

 QNX variable:

QNX_CONFIGURATION=/home/miha/.rim/bbndk
QNX_TARGET=/home/miha/playbook_simulator_2_0/bbndk-2.0/target/qnx6
QNX_HOST=/home/miha/playbook_simulator_2_0/bbndk-2.0/host/linux/x86

 

and have a strange output to the console: (~ 2700 lines in output)

In file included from ../../x86/include/QtCore/qobjectdefs.h:45,
                 from ../../x86/include/QtCore/qobject.h:47,
                 from ../../x86/include/QtCore/qcoreapplication.h:45,
                 from ../../x86/include/QtGui/qapplication.h:45,
                 from ../../x86/include/QtGui/QApplication:1,
                 from main.c:1:
../../x86/include/QtCore/qnamespace.h:54: warning: return type defaults to 'int'
../../x86/include/QtCore/qnamespace.h: In function 'QT_MODULE':
../../x86/include/QtCore/qnamespace.h:54: error: expected declaration specifiers before 'namespace'
../../x86/include/QtCore/qnamespace.h:1799: error: expected declaration specifiers before 'Q_DECLARE_OPERATORS_FOR_FLAGS'
../../x86/include/QtCore/qnamespace.h:1820: error: expected declaration specifiers before 'class'
../../x86/include/QtCore/qnamespace.h:1875: error: expected declaration specifiers before ';' token
In file included from ../../x86/include/QtCore/qobject.h:47,
                 from ../../x86/include/QtCore/qcoreapplication.h:45,
                 from ../../x86/include/QtGui/qapplication.h:45,
                 from ../../x86/include/QtGui/QApplication:1,
                 from main.c:1:
../../x86/include/QtCore/qobjectdefs.h:51: error: expected declaration specifiers before 'QT_MODULE'
../../x86/include/QtCore/qobjectdefs.h:55: error: expected declaration specifiers before 'class'
../../x86/include/QtCore/qobjectdefs.h:143: error: expected declaration specifiers before 'template'
../../x86/include/QtCore/qobjectdefs.h:146: error: expected declaration specifiers before 'template'
../../x86/include/QtCore/qobjectdefs.h:217: error: expected declaration specifiers before 'Q_CORE_EXPORT'

. . . . .
. . . . .

 

Somebody can help me with this? or somebody know what happen and how to resolve this strange situation?

 

Mike.

Highlighted
Developer
Posts: 62
Registered: ‎03-31-2012
My Device: Playbook
My Carrier: None

Re: QT application trouble with compile

[ Edited ]

Did you try to compile it in QtCreator?

 

And did you use the Qt download from: http://openbbnews.wordpress.com/2012/03/29/qt-update-2/

 

There is no real need to compile it by yourself

 

Sry, I could not help you directly, cause I'm using Windows XP to compile for Playbook. The Linux-Installer didn't run with my 32Bit Kubuntu.

 

[edit]

found this:

http://stackoverflow.com/questions/7512433/error-expected-declaration-specifiers-before-namespace

[/edit]

New Developer
Posts: 13
Registered: ‎04-15-2012
My Device: non-blackberry
My Carrier: non-blackberry

Re: QT application trouble with compile

Did u ran qmake? Linked Qt library?
Yes BikeAtor is correct. U need to use IDE? u can use QtCreator or Momentics
New Contributor
Posts: 7
Registered: ‎04-13-2012
My Device: playbook
My Carrier: MTS

Re: QT application trouble with compile

All is simple. Smiley Happy change name of file from *.c to *.cpp and all is working fine now.
New Contributor
Posts: 7
Registered: ‎04-13-2012
My Device: playbook
My Carrier: MTS

Re: QT application trouble with compile

Thanks for replay. I will plan use QTcreator for this. but first I need play with build process from command line for understand. What they are doing and how.

Thnaks all.