PDA

View Full Version : problem with linking



mickey
29th May 2006, 18:53
hi, I've a problem. sometimes my application COMPILING (.net2003) goes very slow (some minutes). Seems it's going slow on mainform.ui.h. What can be the problem? thanks


Generate imagecollection
Compiling...
mainform.cpp
mainform.ui.h(476) : warning C4100: 'action' : unreferenced formal parameter
mainform.ui.h(996) : warning C4100: 'val' : unreferenced formal parameter
my app seems are stopping here above

munna
30th May 2006, 07:19
The warning might not be the only reason for your compilation to become slow. The problem might be somewhere else also.




mainform.ui.h(476) : warning C4100: 'action' : unreferenced formal parameter
mainform.ui.h(996) : warning C4100: 'val' : unreferenced formal parameter



These warnings mean that you are passing the parameters action and val is some function but you are not using them anywhere in the function.

mickey
30th May 2006, 15:14
I know the problems aren't warnings. this is a way to see you where the compiling go slow......

wysota
31st May 2006, 09:29
Do you have any includes in the .ui.h file? If so, could you post respective lines here?

mickey
31st May 2006, 19:25
#include <iostream>
#include <qfont.h>
#include <qtimer.h>
#include <qdom.h>
#include <qfiledialog.h>
#include <qprinter.h>
#include <qstatusbar.h>
#include <qpainter.h>
#include <qrect.h>

sorry, I don't sure to understand.
Mainform.ui.h is a file created from desinger; I haven't included it anywhere...compiling is succefull, but now is became slow; where do I include it??

mickey
1st June 2006, 11:26
Are the include lines above what you wanted?thnsks

mickey
2nd June 2006, 14:16
The liens of include are those:


#include <iostream>
#include <qfont.h>
#include <qtimer.h>
#include <qdom.h>
#include <qfiledialog.h>
#include <qprinter.h>
#include <qstatusbar.h>
#include <qpainter.h>
#include <qrect.h>

wysota
4th June 2006, 10:29
Your includes are fine, it's not a problem with them.

mickey
4th June 2006, 21:12
is it better put them in implementaion (from designer)? what's the problem?thanks

mickey
19th July 2006, 16:55
sorry .Have anyone any hints on my slow linking speed? it goes slow when I change something in mainform.ui.h.....so I thought the problem is there....

wysota
19th July 2006, 17:27
The linking itself should have more or less constant time. The compilation time may vary. Are you sure it is the linking phase that is so time consuming?

mickey
19th July 2006, 17:58
no I'm not sure; I see if I do ; nmake clean; qmake; nmake; on nmake it seems stop on this:


qmake_image_collection.cpp
Generating Code...

then if I change mainform.ui.h and type nmake it seems stop on mainform.cpp

gfunk
19th July 2006, 21:29
If it really is mainform.cpp, maybe you can comment out (temporarily) certain parts of the code in that file to see what might be causing it (though making sure it's still compileable)? Divide and conquer, etc.
Was there something you changed recently that caused the slow linking? Added any libraries?

If it's always been slow, I'd just go ahead and blame Microsoft.

wysota
19th July 2006, 21:36
no I'm not sure; I see if I do ; nmake clean; qmake; nmake; on nmake it seems stop on this:


qmake_image_collection.cpp
Generating Code...

then if I change mainform.ui.h and type nmake it seems stop on mainform.cpp

Then it might be caused by a large number of includes or cycles in inclusions. Try using precompiled headers and don't double include items in .ui.h and designer implementation section. It's enough to include in one of those places (as .ui.h is included into generated implementation file).

mickey
19th July 2006, 22:13
thanks; I have some # at the begon of mainform.ui.h file; other are in implementation from designer (they aren't the same!). is this ok?
THen I subclassed mainform to myMainform: now in mymainform.cpp file I find same include that are in mainform.ui.h; can I avoid this? and how? can this a problem?thanks...

mickey
19th July 2006, 22:43
only possible recursive incude is "mywidget.h" put in mainform.ccp from compiler, and a ponter to mainForm* w, member of mywidget class (inside mywidget.h, but I need it there!!). anyway I use


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

in mywidget.h. Can it be? can I avoid?

wysota
20th July 2006, 00:16
Can it be? can I avoid?

First of all try to use precompiled headers and see how much it helps (it will help much, but if it help too much it means that you may have some include cycles or something like that).

mickey
20th July 2006, 12:13
sorry for question, but what are the precompiled headers? I think you're refer an .net option but wich? I choose generate automatically and don't change nothing in compiling..; others get errors...

mickey
20th July 2006, 13:18
I don't know if can useful to solve problem but after generation code......(where sometimes goes slow) after appear this:


Generating Code...
cl -c -nologo -Zm200 -W3 -w34100 -w34189 -MD -O1 -GX -DUNICODE -DWIN32 -DQT_THREAD_SUPPORT -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEB
UG -I".." -I"C:\code\glew\include" -I"C:\Qt\3.2.0Educational\include" -I"ui\\" -I"D:\XXX\prog\XEd" -I"D:\XXX\prog\XEd" -I"moc\\" -I"C:\Qt\3.2.0Educational\mkspecs\win32-msvc.net" -Foobj\ @C:\DOCUME~1\as\IMPOST~1\Temp\nm126.tmp

wysota
20th July 2006, 18:06
sorry for question, but what are the precompiled headers? I think you're refer an .net option but wich? I choose generate automatically and don't change nothing in compiling..; others get errors...

Read the article (http://wiki.qtcentre.org/index.php?title=Precompiled_Headers) in our wiki (http://wiki.qtcentre.org).

mickey
20th July 2006, 21:09
ok I get out some include from mainform.ui.h; I change .pro and I inserte also stable.h line in include file (in the .pro I mean. right this??). I put #include "stable.h" in mainform.ui.h file
Is it all right? for the moment compilation time is the same...

gfunk
20th July 2006, 21:27
Incidentally, what are the specs on your machine? How fast is it? How much memory does it have?

mickey
20th July 2006, 23:42
500mb, centrino1700;
when I type nmake it's stopping for 49 seconds; after compiling re-start;
I DON'T know if my steps for header precompilated are ok (see before)..i putted about 50 include inside stable.h; don't change anythings.......

mickey
21st July 2006, 01:06
Before:


CONFIG += qt opengl console

an now:


CONFIG += qt opengl console debug


now it dosn't stop in compiling..
Do anyone get me any information? Probabily I don't know........THANKS

wysota
21st July 2006, 01:42
ok I get out some include from mainform.ui.h; I change .pro and I inserte also stable.h line in include file (in the .pro I mean. right this??). I put #include "stable.h" in mainform.ui.h file
Is it all right? for the moment compilation time is the same...

Hmm... The article clearly mentions not to use stable.h as a regular include file, so it's not alright. Did you run qmake after modyfing the project file? And do you meet the requirements for using precompiled headers? Is your compiler supported?

mickey
21st July 2006, 02:04
in effect after I take out stable.h from header lines in .pro but it seems work in the same way yes I typed qmale and nothing requirement.......I use .net 2003


Before:


CONFIG += qt opengl console

an now:


CONFIG += qt opengl console debug

now it dosn't stop in compiling..
Do anyone get me any information? Probabily I don't know........THANKS
But why this above? I notice, when I import project in .net and then type compile option (only compile not build) an apper a "non specificated error" what's it?? why with debug line in .pro dosn't stop but I have this problem in .net? thanks

wysota
21st July 2006, 02:10
Did you actually add the CONFIG += precompile_header statement in the project file? Could you compile your project manually using nmake and paste every line of output which doesn't contain the actual compiler command? Remember to run nmake clean before you run nmake.

mickey
21st July 2006, 02:31
I sent to you!

wysota
21st July 2006, 10:32
What about the project file? Because the output you sent doesn't even mention a try to precompile headers.

mickey
21st July 2006, 10:52
I sent you; but do anyone explain why if i insert option debug in .pro, compilation goes fast? and if I import .pro in .net 2003 building give me this:


Project configuration skipped because it is not loaded

Thanks

mickey
21st July 2006, 11:51
Hi, I cut out a toolBox and every things referer to it in mymainform.cpp; now the time stopping on "generatin code" is 4 seconds!!! I think problem is there?!?!?Before to do this I tried to comment all connect in mymainform but don't change...so toolbox!! what can it be????thanks

jacek
21st July 2006, 12:21
What is the total size in kB of icons you use in your application?

mickey
21st July 2006, 12:28
332 KB; but in that toolbox there aren't...i'm trying incrementaly cut out widget from toolbox; now stop time is fall down 18 sec......

jacek
21st July 2006, 12:35
What is the size of qmake_image_collection.cpp file (the autogenerated one that contains image collection)?

mickey
21st July 2006, 12:54
ui/qimagecollection.cpp is 2.55 MB high?! why?

jacek
21st July 2006, 12:59
ui/qimagecollection.cpp is 2.55 MB high?! why?
Are you sure that there is no coincidence between generation and compilation of that file and long build time of your project?

mickey
21st July 2006, 13:55
hi, i don't sure what you want say. I'm not sure anythings.
But i deleted /images directory and the lines in .pro of images....the problem doens't change...do you refer to this?

wysota
21st July 2006, 14:12
Is there any possibility that you could send us all your project files, so that we could check the project ourselves?

mickey
21st July 2006, 14:43
are you speaking of .pro or all files? in the second case, yes; but Will it be possible delete it after? (i don't like it online at this time...)..or give me another way to give you two...thanks

wysota
21st July 2006, 15:12
Send it via mail to qtcentre at qtcentre.org

wysota
21st July 2006, 18:14
You have some nasty errors in your project. It refuses to compile because of some missing files.

mickey
21st July 2006, 19:15
nasty errors? missing files? I don't sure to understand the thing....

wysota
21st July 2006, 20:35
My compilation log:

$ qmake
WARNING: Failure to find: mylightdialog.h
WARNING: Failure to find: ../MG/face.h
WARNING: Failure to find: myfiledialog.h
WARNING: Failure to find: wwFloatspinbox.h
WARNING: Failure to find: mylightdialog.cpp
WARNING: Failure to find: myfiledialog.cpp
WARNING: Failure to find: wwFloatspinbox.cpp
WARNING: Failure to find: ../MG/face.cpp


$ make
/usr/lib/qt3//bin/uic initplaindialog.ui -o .ui/initplaindialog.h
/usr/lib/qt3//bin/uic mainform.ui -o .ui/mainform.h
/usr/lib/qt3//bin/uic configDialog.ui -o .ui/configDialog.h
/usr/lib/qt3//bin/uic progressdialog.ui -o .ui/progressdialog.h
/usr/lib/qt3//bin/uic lightdialog.ui -o .ui/lightdialog.h
test -d Editor.gch/ || mkdir -p Editor.gch/
g++ -x c++-header -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I.. -IC:\code\glew\include -I/usr/lib/qt3//include -I/usr/X11R6/include -I/usr/X11R6/include -I.ui/ -I. -I.moc/ stable.h -o Editor.gch/c++
stable.h:12:26: error: myfiledialog.h: No such file or directory
In file included from ../vcg/Point3.h:32,
from ../MG/plain.h:5,
from ../MG/scene.h:4,
from .ui/mainform.h:16,
from mymainform.h:4,
from stable.h:19:
../vcg/Utility.h:76:7: warning: no newline at end of file
In file included from ../MG/scene.h:4,
from .ui/mainform.h:16,
from mymainform.h:4,
from stable.h:19:
../MG/plain.h:15:18: error: face.h: No such file or directory
In file included from ../MG/scene.h:8,
from .ui/mainform.h:16,
from mymainform.h:4,
from stable.h:19:
../MG/light.h:70:7: warning: no newline at end of file
stable.h:21:50: error: mywidget.h: No such file or directory
stable.h:28:30: error: myprogressDialog.h: No such file or directory
In file included from stable.h:56:
./myLightDialog.h:27:8: warning: no newline at end of file
stable.h:86:7: warning: no newline at end of file
../MG/plain.h:52: error: 'Face' was not declared in this scope
../MG/plain.h:52: error: template argument 1 is invalid
../MG/plain.h:52: error: template argument 2 is invalid
../MG/plain.h:19: warning: 'class MMCell' has virtual functions but non-virtual destructor
../MG/plain.h:77: error: 'GLuint' was not declared in this scope
../MG/plain.h:77: error: template argument 1 is invalid
../MG/plain.h:77: error: template argument 2 is invalid
../MG/plain.h:91: error: 'GLint' does not name a type
../MG/plain.h:126: error: 'GLuint' does not name a type
../MG/plain.h:127: error: 'GLuint' does not name a type
../MG/plain.h:128: error: 'GLuint' does not name a type
../MG/plain.h:159: error: 'GLint' does not name a type
../MG/plain.h: In member function 'int Plain::get_z()':
../MG/plain.h:161: warning: converting to 'int' from 'float'
make: *** [Editor.gch/c++] Error 1

mickey
21st July 2006, 20:59
of course I don't understand many of these errors. but my compilation is successful; slow but successful; I haven't that warning even if I set level warning 4 in .net...Why this difference...? the files missing...there are! or not?

jacek
21st July 2006, 21:04
Why this difference...?
IMO the problem in file names. In the .pro file all file names are in lowercase, but some files have mixed case in their names --- this doesn't make any difference on windows, but on Linux file names are case sensitive.

wysota
21st July 2006, 21:18
As you can see here:

test -d Editor.gch/ || mkdir -p Editor.gch/
g++ -x c++-header -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I.. -IC:\code\glew\include -I/usr/lib/qt3//include -I/usr/X11R6/include -I/usr/X11R6/include -I.ui/ -I. -I.moc/ stable.h -o Editor.gch/c++
gcc tries to build the precompiled header. I haven't seen a similar line in your log. Maybe your compiler doesn't support it after all.

BTW. You should change your stable.h. Only include directives should be there. No "using namestace std" calls or simmilar. And put there only those files which are known not to be changed during the life of the project (like Qt includes) and try to avoid includes local to your project unless you're sure they won't change frequently. And please, NEVER include "stable.h" from other files. Only include those files which you really need. Otherwise you'll increase the compilation complexity for environments which don't support precompiled headers.

That part is interesting too:

-IC:\code\glew\include

What happens if you try to compile the project on a machine which uses different paths? And try to use slashes instead of backslashes, it's more portable.

mickey
21st July 2006, 21:41
As you can see here:

gcc tries to build the precompiled header. I haven't seen a similar line in your log. Maybe your compiler doesn't support it after all.

BTW. You should change your stable.h. Only include directives should be there. No "using namestace std" calls or simmilar. And put there only those files which are known not to be changed during the life of the project (like Qt includes) and try to avoid includes local to your project unless you're sure they won't change frequently. And please, NEVER include "stable.h" from other files. Only include those files which you really need. Otherwise you'll increase the compilation complexity for environments which don't support precompiled headers.

That part is interesting too:
What happens if you try to compile the project on a machine which uses different paths? And try to use slashes instead of backslashes, it's more portable.

If I tried to copiled on other machine wich different path glew.h doesn't compile...
I don't still understand: why your compiler gets error and mine not?
But the thing that I take out toolbox the time compiling is right, what is it? a case?
Ok my compiler dosns't support it, but what can be the cause of that? what do you say about this (i activated debug mode):


mywidget.cpp(1279) : warning C4100: 'e' : unreferenced formal parameter
mywidget.cpp(1332) : warning C4100: 'e' : unreferenced formal parameter
mymainform.cpp
Generating Code...
c:\programmi\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programmi\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
//here is working the same long time.....

mickey
22nd July 2006, 01:18
Hi, I don't know what I changed (some include <vector>) but this warning go up.. (i'm set level warnig4 from .net); do anyone say me if this can be error; I tried this on an old copy of my project and those warning there aren't...in that copy I don't declare any vector inside some .h; but I need that...


c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1116) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1118) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1121) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(834) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\vector(857) : warning C4702: unreachable code
c:\programs\microsoft visual studio .net 2003\vc7\include\xtree(1136) : warning C4702: unreachable code
Linking...
LINK : warning LNK4199: /DELAYLOAD:comdlg32.dll ignored; no imports found from comdlg32.dll
LINK : warning LNK4199: /DELAYLOAD:oleaut32.dll ignored; no imports found from oleaut32.dll
LINK : warning LNK4199: /DELAYLOAD:winmm.dll ignored; no imports found from winmm.dll
LINK : warning LNK4199: /DELAYLOAD:wsock32.dll ignored; no imports found from wsock32.dll
LINK : warning LNK4199: /DELAYLOAD:winspool.dll ignored; no imports found from winspool.dll

wysota
22nd July 2006, 01:22
I don't still understand: why your compiler gets error and mine not?

<flame mode>Because mine is better?</flame mode>

And seriously, I think Jacek already told you why...

mickey
12th August 2006, 22:41
<flame mode>Because mine is better?</flame mode>
And seriously, I think Jacek already told you why...
HI,
I compiled app under linux and I see that the time of compile&link is THE SAME (2 seconds difference) ; but the difference is that under linux the process doesn't stop in any place; it was printing lines without stop....
can I email you output of compile? (maybe you'll can see something wrong) Thanks