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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 40
Registered: ‎02-27-2011
My Device: Not Specified
Accepted Solution

Setting up qt includes in Momentics

I'm new to Momentics (used Eclipse for a while years ago) and don't understand how includes work. I'm attempting a Qt Hello World and have this

#include "qt4/QtGui/qapplication.h"

 The compiler finds that, but when parsing that file it can't find the includes specified there. For example,

 

C:/bbndk-2.1.0/target/qnx6/usr/include/qt4/QtGui/qapplication.h:45:37: error: QtCore/qcoreapplication.h: No such file or directory

 

I've tried several possibilities in Project>Properties>C++ General>Paths and Symbols>Includes but haven't succeeded in making other Qt internal paths findable.

How should I set this up?

Thanks.

Developer
Posts: 217
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Setting up qt includes in Momentics

You can just right click on your code and select Source > Add Include. Or select your code and type Ctrl + Shift + N. Both will add your include automatically. Works fine for me.

Contributor
Posts: 40
Registered: ‎02-27-2011
My Device: Not Specified

Re: Setting up qt includes in Momentics

Thanks for your reply.

The problem is not adding the required includes for my own code but arises when trying to find the includes required by the headers I specifically reference. For example, I include qapplication.h which is in QtGui. The preprocessor opens it and tries to parse it. The first directive in that file is #include <QtCore/qcoreapplication.h> and that's the directory the preprocessor can't find.

 

I thought that adding an include path pointing to the directory qt4, which contains both QtGui and QtCore would work, but it didn't.

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Setting up qt includes in Momentics

I had to add several include paths, like:

C:/bbndk-2.1.0/target/qnx6/usr/include/qt4/

C:/bbndk-2.1.0/target/qnx6/usr/include/qt4/QtGui

C:/bbndk-2.1.0/target/qnx6/usr/include/qt4/QtCore

+ whatever else you use like

C:/bbndk-2.1.0/target/qnx6/usr/include/qt4/QtNetwork etc.

Highlighted
Contributor
Posts: 40
Registered: ‎02-27-2011
My Device: Not Specified

Re: Setting up qt includes in Momentics

Thanks, BGmot. I don't think I did try adding all of them. I'll try it.

Contributor
Posts: 40
Registered: ‎02-27-2011
My Device: Not Specified

Re: Setting up qt includes in Momentics

That did the trick. Thanks again.

 

In case another Momentics newbie reads this thread, in Paths and Symbols, the list of languages on the left is not there for information. You have to select from it; GNU C is the one. (That was my first mistake when I started on this.)

 

And BGmot many, many thanks for your post "QTHelloWorld in Momentics IDE"  It was invaluable (once I found it!).

 

Ron

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Setting up qt includes in Momentics

This blog post is very old. I wouldn't use NDK to develop Qt for BB. Use Qt creator - more natural way.