12-09-2012 04:46 PM
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/q
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.
Solved! Go to Solution.
12-11-2012 10:18 AM
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.
12-11-2012 01:48 PM
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.
12-11-2012 04:37 PM
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/QtNetwo
12-11-2012 04:54 PM
Thanks, BGmot. I don't think I did try adding all of them. I'll try it.
12-11-2012 10:50 PM
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
12-12-2012 09:21 AM
This blog post is very old. I wouldn't use NDK to develop Qt for BB. Use Qt creator - more natural way.