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
The compiler finds that, but when parsing that file it can't find the includes specified there. For example,
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?
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:
+ whatever else you use like
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!).