|
|
Re: Symbols from included headers are not to be found [message #793964 is a reply to message #793684] |
Wed, 08 February 2012 19:38 |
Marcell Kehmstedt Messages: 5 Registered: February 2012 |
Junior Member |
|
|
Axel Mueller wrote on Wed, 08 February 2012 07:40Marcell Kehmstedt wrote on Wed, 08 February 2012 10:51
Under "Paths and Symbols" I added my QT headers which are also displayed in the project explorer.
Did you add all possible include paths? Subfolders are not automatically included! Did you add the include paths to C and C++?
Yes, all paths with header and source files are added to the project and are shown within the project explorer. And all those include paths are added to the include directories (under Paths and Symbols) for C and C++ as well.
Axel Mueller wrote on Wed, 08 February 2012 07:40
Quote:
Within my header files, which include the QT headers, everything is fine so far (except little qt specific details like the macro Q_OBJECT is not known as well as "public slots:" and so on).
That is already an error. These macros should be resolved. Are the Qt includes marked as unresolved?
No. The include directives like
are not marked yellow or red and I am possible to open those files from within Eclipse when right clicking on that directive and selecting "Open Declaration".
Axel Mueller wrote on Wed, 08 February 2012 07:40
Quote:And how I can make Eclipse resolve those symbols from the included headers?
I would suggest to create a linked folder in your Eclipse project that contains the Qt headers.
Hmm, that might be a work around, I would not like to do - whether it might work or not.
The reason is, that I would like set up an Eclipse project that I can transfer to another machine for testing and debugging reasons, because the machine I'm developing on is not the target machine.
I mean, there must be a legal way of adding includes in a standard way.
Maybe I should give you an example, so you can understand my problem.
Here is an excerpt from the header file (MainWindow.h) of my MainWindow:
#include <QtGui>
class MainWindow : public QMainWindow //<- no warnings or errors from Eclipse!
{
Q_OBJECT //<- Syntax error
public:
MainWindow(QWidget * parent = 0, Qt::WindowFlags flags = 0); //<- Type 'Qt::WindowFlags' could not be resolved
virtual ~MainWindow();
public slots: //<- Syntax error
};
And here is an excerpt from the corresponding source file:
#include "MainWindow.h"
MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) //<- Member declaration not found
{
setWindowTitle(); //<- Could not be resolved
setCentralWidget(); //<- Could not be resolved
}
Both files are placed within the same folder and this folder is part of the include directories within the project properties.
I hope this helps a bit. And thank you for your answer so far!
|
|
|
|
|
|
|
|
Re: Symbols from included headers are not to be found [message #794586 is a reply to message #794582] |
Thu, 09 February 2012 13:22 |
Marcell Kehmstedt Messages: 5 Registered: February 2012 |
Junior Member |
|
|
Ok. Seems I have some big extra work to do.
But I will try it. Thanks so far!
But here comes another funny issue:
The same problem I described above for my Mac appears in the same form on the target machine running Scientific Linux.
The only thing I haven't tried on that machine is to modify the file types listing in Eclipse as you discribed it above.
I am going to do this in a moment...
[Updated on: Thu, 09 February 2012 13:22] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03831 seconds