PDA

View Full Version : HUGE BUG in Windows Installation!!!



joandelason
21st March 2010, 09:01
Hi
I wanted to report a HUGE bug that I found after Windows installation.
When you install Qt on Windows, the examples folder is under (or in) the 2010.xx.xx folder, which is in the Qt folder). I found out that this is why the examples don't link. A huge list of warnings like C:\Qt\2010.02.1\qt\demos\embedded\fluidlauncher/demoapplication.cpp:49: undefined reference to `_imp___ZN7QObjectC2EPS_' and this error c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c::-1: error: undefined reference to `WinMain@16' show up in the build log (and lots of others in the compiler's log). After moving the examples to the Qt folder, it works. I think this must be due to the dots in the folder name or something.
This also goes for my projects and the demos folder. I put my projects folder in C:\ and the demos in Qt and they work fine.

I almost went mad trying to solve it !!!. I first thought the problem was that I had an old version of the mingw compiler (I had the version of DevC++). Then I thought that it could be a conflict with the Visual Studio compilers.

There are also lots of threads of people having the same problem.

In fact I didnt solve it. It was twt204 who did it.
I read his post in
http://www.qtcentre.org/threads/26915-WinMain-16-compiler-error-in-Qt-examples?highlight=winmain

So its his credit.

Hope this will be fixed in the next version.

Qt rocks!!!

wysota
21st March 2010, 09:12
You can build the examples from any place you want (provided you have access rights, of course). So what you found is not a bug (and if it was, it would be a bug of the compiler or shell, not Qt), the examples and demos are in the right place.

joandelason
21st March 2010, 11:38
You can build the examples from any place you want (provided you have access rights, of course). So what you found is not a bug (and if it was, it would be a bug of the compiler or shell, not Qt), the examples and demos are in the right place.

Hi
The compiler is qmake.
I have looked up for similar posts of people who have the same problem.
Here are some:

http://www.qtcentre.org/threads/28992-Qt-Creator-fail-to-compile-!
http://www.qtcentre.org/threads/27429-Prblem-in-Building-and-running-Examples?highlight=example+error
http://www.qtcentre.org/threads/26915-WinMain-16-compiler-error-in-Qt-examples?highlight=example+error (this one is the one I refer above)
http://www.qtcentre.org/threads/23338-Qt-Creator-Just-one-linking-error?highlight=example+error

Im not saying that all of them are due to the same reason, but could you check it out by installing the current free version of Qt on Windows and compiling the examples/demos in their original folder?

And if anyone has the same problem and this solution works, please add a post. If its actually a bug, it will help the comunnity.

Just to make sure.

THANKS.

Grimlock
21st March 2010, 12:23
Hi
The compiler is qmake.
I have looked up for similar posts of people who have the same problem.
Here are some:

http://www.qtcentre.org/threads/28992-Qt-Creator-fail-to-compile-!
http://www.qtcentre.org/threads/27429-Prblem-in-Building-and-running-Examples?highlight=example+error
http://www.qtcentre.org/threads/26915-WinMain-16-compiler-error-in-Qt-examples?highlight=example+error (this one is the one I refer above)
http://www.qtcentre.org/threads/23338-Qt-Creator-Just-one-linking-error?highlight=example+error

Im not saying that all of them are due to the same reason, but could you check it out by installing the current free version of Qt on Windows and compiling the examples/demos in their original folder?

And if anyone has the same problem and this solution works, please add a post. If its actually a bug, it will help the comunnity.

Just to make sure.

THANKS.

qmake is not a compiler :p
I think the default compiler Qt is shipped with for windows is mingw (gcc)

wysota
21st March 2010, 14:16
The compiler is qmake.
QMake is a build manager, not a compiler, as already stated.


I have looked up for similar posts of people who have the same problem.
Here are some:

http://www.qtcentre.org/threads/28992-Qt-Creator-fail-to-compile-!
http://www.qtcentre.org/threads/27429-Prblem-in-Building-and-running-Examples?highlight=example+error
http://www.qtcentre.org/threads/26915-WinMain-16-compiler-error-in-Qt-examples?highlight=example+error (this one is the one I refer above)
http://www.qtcentre.org/threads/23338-Qt-Creator-Just-one-linking-error?highlight=example+error
Lots of people are having problems with classes in Qt applications. Does it mean Qt supports classes incorrectly?


Im not saying that all of them are due to the same reason, but could you check it out by installing the current free version of Qt on Windows and compiling the examples/demos in their original folder?

Did you try running make distclean && qmake && make?

wysota
21st March 2010, 14:16
The compiler is qmake.
QMake is a build manager, not a compiler, as already stated.


I have looked up for similar posts of people who have the same problem.
Here are some:

http://www.qtcentre.org/threads/28992-Qt-Creator-fail-to-compile-!
http://www.qtcentre.org/threads/27429-Prblem-in-Building-and-running-Examples?highlight=example+error
http://www.qtcentre.org/threads/26915-WinMain-16-compiler-error-in-Qt-examples?highlight=example+error (this one is the one I refer above)
http://www.qtcentre.org/threads/23338-Qt-Creator-Just-one-linking-error?highlight=example+error
Lots of people are having problems with classes in Qt applications. Does it mean Qt supports classes incorrectly?


Im not saying that all of them are due to the same reason, but could you check it out by installing the current free version of Qt on Windows and compiling the examples/demos in their original folder?

Did you try running make distclean && qmake && make?

Lykurg
21st March 2010, 14:50
Please avoid double posting:D
And I have checked the issue here with WinXp, Qt SDK 2010.02.1, gone to demos/embedded/fluidlauncher and done qmake and mingw32-make and all went fine, so I think that this is hardly a bug.

joandelason
21st March 2010, 16:37
I "played" it with Qt creator.
Lets not call it a bug, let's call it an issue Twt204 and I had :).

This is his post.

Hi,

I've got an interesting error in qt when running the examples from the welcome screen of qt 1.3.0.

I've tried several of the examples, including 2dpainting under the OpenGl category. Each example gives me 2 errors and about 200 warnings. The errors are:

1. undefined reference to 'WinMain@16" c:\nokia\qt\2009.05_new\mingw\bin\...\lib\gcc\ming w32\4.4.0\..\..\..\libmingw32.a(main.o):main.c:

2. collect2: ld returned 1 exit status

and the warnings are all "undefined reference to '_imp___Z.....'"

I'm running qt creator 1.3 and qt 4.6.0. Oddly enough the MyFirstApp program I've written myself compiles and runs fine. I'm compiling in qt using the default configuration (my OS is WinXP.)


So, how can I compile/run the examples in qt?
Thanks.


And after a few failed attemtps he says


Get this: The file you attached WORKS for me, provided I don't put it into the same folder as the stickman example.

My example files are under C:/Nokia/Qt/2009.05_new/qt/examples/animation/stickman_ex/stickman.pro , etc
Anything I create goes under C:/Programming/Nokia/stickman_ex , etc
Now, why does this identical folder work when I put it in any directory other than the default directory?

So, what I've done is moved my entire examples directory to C:/Nokia/Qt and now all of the examples I've tested compile.
Albarian, I'm running Win XP SP3 as well. Does moving the examples directory help you?


Who knows what it could be? Maybe it has something to do with the OS, the compiler, or whatever (though it'd be interesting to find out why).
I'm using Windows 7 with gcc v 3.4.5 (mingw32-vista special r3).


But its ok.

wysota
21st March 2010, 21:19
The "problem" is people forget (or they don't understand) they should call "qmake" before calling "make" (or hitting the triangle-shaped button in Creator). A simple analysis of the Makefile before regenerating it with qmake will reveal the reason. Which is left as an exercise to the reader, of course.

As for the future - if something doesn't work, please check ten times what the problem is and before you do understand the reason for the problem, don't proclaim you have found a bug in someone else's software. It might get you embarrased if someone points out the problem in what you were doing. Remember, if something doesn't work as expected, it's not enough to be talking about bugs. Only when you have discovered the cause of the malfunction (and I mean the cause, not the way to reproduce the "issue"), you can start looking for a bug spray. And sometimes even then you should think again, if you are not assuming something which is not correct (aka I am a special and unique individual who has managed to find a bug with a method thousands of people use every day in all their programs - like adding two QStrings together or something like that or hey, I have been using a wrong or undocumented feature in Graphics View and the latest release is bugged because they fixed/changed it and my abusive code doesn't work anymore).

joandelason
22nd March 2010, 09:07
Sorry. You are right.
I let myself be carried away by the excitement of having solved it.