PDA

View Full Version : error compile



mickey
26th February 2006, 17:08
Hi, I have this error; my command is: nmake clean; qmake; nmake (the last get this error)
NMAKE : fatal error U1071: cycle in dependency tree for target 'ui\mainform.h'
Stop.
What happen?

wysota
26th February 2006, 17:41
Could we see the project file?

mickey
26th February 2006, 19:46
SOURCES += main.cpp \
widget.cpp \
plainit.cpp

HEADERS += widget.h \
plainit.h

DISTFILES += program.txt
message( "version 0.5" )
DESTDIR = .


unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}
win32 {
UI_DIR = ui
MOC_DIR = moc
OBJECTS_DIR = obj
thread {
DEFINES += QT_THREAD_SUPPORT
}
}


# Input

FORMS = aboutform.ui \
initplaindialog.ui \
mainform.ui \
optiondialog.ui
IMAGES = images/4view.png \
images/widgetstack.png \
images/wireFrame.png \
images/grid1.png \
images/light0.png \
images/hole.png \
images/ice.png

TEMPLATE =app
CONFIG += qt opengl console
INCLUDEPATH += .. C:\code\glew\include
win32:LIBS += C:\code\glew\lib\glew32.lib
LANGUAGE = C++

It worked! I deleted some icon, label .....from qtDesigner and now don't compile

yop
26th February 2006, 21:42
NMAKE : fatal error U1071: cycle in dependency tree for target 'ui\mainform.h'
Stop.
Delete your old Makefile and then qmake to generate a new one.

mickey
26th February 2006, 22:55
Everytime I do: nmake clean; qmake; nmake. But problem persist..

wysota
26th February 2006, 23:18
Everytime I do: nmake clean; qmake; nmake. But problem persist..

"clean" does not remove the Makefile.

wysota
26th February 2006, 23:29
Could you post your mainwindow.ui file? As attachment please :)

mickey
27th February 2006, 10:36
I have delete makefile; it's the same
yes here mainform.ui file...thanks

wysota
27th February 2006, 11:31
You are including the .ui file into that same .ui file? Why so?

mickey
27th February 2006, 15:04
I don't to do this; from designer (in implementation) there isn't mainform.ui.h; in mainform.h the same....I see now that I have 2 <optiondiaog.h> in mainform. h.
What is happen? How change it? I edit mainform.ui.h and delete the line?
thanks

mickey
27th February 2006, 15:27
HI, I tried to delete the line in mainform.ui.h (now there isn't). But problem don't change...
I think the problem is inside myToolbox: I have enable/disable it form qtDesigner but I see that some object inside it (label, spinbox...) aren't going enable! And from qt designer I can't enable object inside myToolbox. How can do?

wysota
27th February 2006, 16:08
I don't to do this;

If you open that .ui file in a text editor, you'll see (near the end of the file) a line telling that you do.

mickey
27th February 2006, 16:18
yes see. But designer has add this line. I have an older version of mainform.ui that has the same line

<include location="local" impldecl="in implementation">mainform.ui.h</include>
but this compile successfully....
I don't understand....

wysota
27th February 2006, 17:21
Ah... ok, I missed that ".h" at the end of the entry. Where do you include mainwindow.h? Could you find all occurences?

mickey
27th February 2006, 17:37
I have an old version of my mainform.ui and substituting it, compile! the problem seems inside this file....but this copy is very older.....

mickey
28th February 2006, 16:12
Sorry but I am still stop.....Any other suggests?

mickey
28th February 2006, 23:43
Hi,
I change including <mywidget.h> from declaration to implementation (in qtDesigner) and now compile. But Why?
Thanks

wysota
1st March 2006, 07:07
And what is mywidget.h? Could we see its contents? Are you by any chance including mainwindow.h there?

mickey
1st March 2006, 11:53
ifndef MYWIDGET_H
#define MYWIDGET_H
#include <qgl.h>
#include <qpoint.h>
#include <qtimer.h>
#include "mainform.h"
class MainForm;
#define BUFSIZE 512

class MyWidget : public QGLWidget
{
Q_OBJECT
public:

MyWidget( QWidget *parent = 0, const char *name = 0, const QGLWidget* shareWidget = 0);
~MyWidget();
.........
};

Is it #include "mainform.h" the problems? I need take it here... But wich is different between include in implem and in declaration? I thought it was the same for success of compile...

wysota
1st March 2006, 17:16
Is it #include "mainform.h" the problems?
Probably yes.


I need take it here...No you don't. Do you use methods defined there?

But wich is different between include in implem and in declaration? I thought it was the same for success of compile...
No. You should avoid including to much files in headers, because it slows down the compilation. But the reason of failure might be that qmake sees that it needs that included file in the current file, but that file is included in the other one, so it depends on it and thus it creates a cycle. Of course it might be something different, but you should try removing that include from the header file.

mickey
1st March 2006, 22:09
No you don't. Do you use methods defined there?

yes I use members of mainform from here; But if I put it in implementation compile..
[QUOTE=wysota]
No. You should avoid including to much files in headers, because it slows down the compilation. [QUOTE]
including much headers where? from QTdesigner? in implementation? in declarations? Or at begin of file by hand?

thanks

wysota
1st March 2006, 23:20
including much headers where? from QTdesigner? in implementation? in declarations? Or at begin of file by hand?

In header files. Because each file which includes that file will also include all the files including it and each time cpp has to parse them. That's why using precompiled headers results in such a big speed gain ;) Parsing header files takes much time.

mickey
2nd March 2006, 09:42
Sorry but I have some problems with english also. Do you say me to put #incldue much more In implementation or implemention (from qtDesinger).
And is this an help for speed:


#ifndef MYWIDGET_H
#define MYWIDGET_H
.......

Thanks