PDA

View Full Version : Please help me - make error



Gily
19th December 2007, 07:34
I run the sample project and got error:(

The project - C:\Qt\4.3.3\examples\widgets\imageviewer
===========
Severity and Description Path Resource Location Creation Time Id
make[1]: *** [release\imageviewer.exe] Error 1 imageviewer line 0 1198013082034 730
make: *** [release] Error 2 imageviewer line 0 1198013082034 731
===========:crying::crying:

When I import the project it works fine but, I added - save option and got this error. Since there is not line number I am not sure how to debug it :rolleyes:
Thanks

marcel
19th December 2007, 07:43
Can you post some code?

Gily
19th December 2007, 07:50
just past here? I am based on example like I wrote. I mark the changed I did
BTW: anyonw knows why there is no distractor?

marcel
19th December 2007, 08:05
I hope this

===========================================
imageviewer.h
===========

isn't part of the header.



BTW: anyonw knows why there is no distractor?


Because the actions and menus are deleted by their QObject parents. Now that you've added the QImage pointer you should add a destructor and delete that QImage in there.

Gily
19th December 2007, 08:33
yes, sorry, I just added is by mistake to the forum- it is not in the code
===========================================
imageviewer.h
===========
---------------------------------------------------------------
I attached all the file at the end of my last message.
---------------------------------------------------------------


about the distractor:
you wrote
"now that you've added the QImage pointer you should add a destructor and delete that QImage in there"

but what about the QLabel? I don't see why there is no distractor for the label, there is no difference between QLabel and QImage (or I am wrong?)
thanks:)

high_flyer
19th December 2007, 10:48
but what about the QLabel? I don't see why there is no distractor for the label, there is no difference between QLabel and QImage (or I am wrong?)
thanks

QObject docs:

QObjects organize themselves in object trees. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The parent takes ownership of the object i.e. it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren().
But if you QObject is parent less, you need to take care of cleaning it your self.

wysota
19th December 2007, 10:51
But if you QObject is parent less, you need to take care of cleaning it your self.

Just note that even if you didn't point the parent explicitely, the widget might get reparented by Qt (for instance if you add it to a layout).

Gily
19th December 2007, 11:02
now I understand the the distractor aspect, thanks.
is it a mistake to write distractor, or is it just not needed?


still have the make problem :confused: and my project is stuck. can anyone assist me please?
I use QT Eclipse integration.

high_flyer
19th December 2007, 11:05
When I import the project it works fine but, I added - save option and got this error.
What steps did you take?
Can you list them in order?

Gily
19th December 2007, 11:18
sure
yo can also see them in the files above in their content(I maked them)
oops is it possible that someone erased them?
hope it will bw clear now
I chnage 2 file: imagevewer.h ,imagevewer.cpp
I wanted to add save and more menu-effects

marcel
19th December 2007, 11:21
oops is it possible that someone erased them?

Yes, I deleted the inline code because you already attached the source files.
Please don't post anymore code that already is in the files you attached.

high_flyer
19th December 2007, 11:29
I didn't mean code changes, but in the project.
But that is not relevant I see, since you changed only code in already existing project files, so basically your project is the same as before the changes if I understand correctly.

high_flyer
19th December 2007, 11:31
if you do qmake make from the console (Qt console!) does it compile then?

Gily
19th December 2007, 13:18
Hi All
I changed the code from the original project. I wrote the changes above but marcel prefer to delete them
like I wrote I add save and effect that were not in the original project. if the project file doesn't change automaticly I didn't change it.

ok, did my best and make in prompt window
this is the result.
BTW:this is the way you debug in QT? not so freindly:-(
-----------------------------------------------------------------------------------------------------
:\download\poy>make imageviewer
++ imageviewer.cpp -o imageviewer
mageviewer.cpp:37:17: QtGui: No such file or directory
n file included from imageviewer.cpp:39:
mageviewer.h:40:23: QMainWindow: No such file or directory
mageviewer.h:41:20: QPrinter: No such file or directory
..
..
..
see in the file attached

high_flyer
19th December 2007, 13:20
did you do this in Qt console or the normal console?
It looks your Qt environment is not set in the console you did this.
Run qmake before you run make too.


BTW:this is the way you debug in QT? not so freindly:-(
Well, as far as windows goes, I find it much friendlier then the IDE's.
Usually, all you need to do is qmake & make and it will compile (provided your environment is setup correctly), while the IDE will tangle and to problems with the same project tree.
In addition, this way you can be sure that its not some IDE related issue.

Gily
19th December 2007, 13:30
delete existing pro file?

high_flyer
19th December 2007, 13:59
huh?
why?
If all your sources are in one directory though, you could - or just do:
qmake -project

Gily
19th December 2007, 14:23
I did
what happend is:

C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>qmake -project

C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>make imagevier
mingw32-make: *** No rule to make target `imagevier'. Stop.

wysota
19th December 2007, 14:50
I wrote the changes above but marcel prefer to delete them
I asked him to. Don't expect us to read two codes and compare them line by line manually. We assumed both sets contain the same content.


C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>qmake -project

C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>make imagevier
mingw32-make: *** No rule to make target `imagevier'. Stop.

The steps are qmake -project && qmake && make.

Gily
19th December 2007, 15:28
this is what happend


C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>qmake -project

C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>qmake poy3.pro

C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>make roy3
mingw32-make: *** No rule to make target `roy3'. Stop.
==========================================
I saw there is poy3.pro in the folder
==========================================
"asked him to. Don't expect us to read two codes and compare them line by line manually. We assumed both sets contain the same content."
I am sorry I just wanted to give all the information have.
at the first time I manualy added //change near every line I changed
in the second time I just put the code I changed
please tell me what is the best way to give the info, so I can be helped
thanks

marcel
19th December 2007, 15:34
C:\Documents and Settings\chikon\My Documents\Eclips projects\poy3>make roy3

Run just "make", without parameters. The default target will be built.

Gily
19th December 2007, 15:57
it worked, thanks

I put it as atached file.

is it ok to write the lines I changed only?

jpn
19th December 2007, 17:58
undefined reference to `ImageViewer::applyEffect()'
You have declared a slot called ImageViewer::applyEffect() but not implemented it.

Gily
19th December 2007, 18:29
thanks@
just fixed it and now it works thanks to you all
can't believe I wasted 24 hours on this! just wanted to check if things are working before I do the image effects.


how do u find compile error ? what is this long list before the error message?
what toold do you use to debug and to find error?

long day......

jacek
19th December 2007, 19:44
how do u find compile error ?
IDEs can find error messages for you. Since errors are printed on the stderr, you can use "make > NUL" to filter out non-error messages.


what is this long list before the error message?
The lines starting with "mingw32-make" are from make which tells you what it's doing at the moment and the lines starting with "g++" are the actual commands that were used to compile your application.


what toold do you use to debug and to find error?
If your program compiles, but it doesn't work, you can use a debugger (for example gdb), but it's useful only if you don't know what your program does.

Gily
20th December 2007, 07:17
thanks, usefull info:)