PDA

View Full Version : What constitutes valid Qt folder?



piotr.dobrogost
18th July 2009, 20:33
I have three qt versions

c:\qt\4.5.2 - qt installed by installer
c:\qt\4.5.2-gcc - qt compiled from sources in z:\qt-src using mingw gcc 4.4.0
c:\qt\4.5.2-vc - qt compiled from sources in z:\qt-src using vc++ from vs2008

When I'm setting them in Qt Creator I get the error
"[one of the above three paths] is not a valid Qt directory"

What constitutes valid (from Qt Creator point of view) Qt folder end where can I find documentation on this subject?

wysota
19th July 2009, 21:37
"mkspecs" directory containing the "default" directory containing the qmake.conf file and qmake binary in the bin subdirectory of the installation.

piotr.dobrogost
19th July 2009, 21:49
I think it's not all that is needed.
From what I see the path of qt is checked against the one compiled into qmake and if they don't match the folder is regarded as not valid by creator.
Can you confirm this?

Could you please ask someone in Qt to put this information in documentation?

wysota
19th July 2009, 21:56
From what I see the path of qt is checked against the one compiled into qmake and if they don't match the folder is regarded as not valid by creator.
Can you confirm this?

I don't even understand what you mean. I don't know what you mean by "path of qt". I know my default Qt installation is under /usr/ and this path is definitely not compiled into qmake (which is in /usr/lib/qt4/bin/qmake softlinked to /usr/bin). From this it is quite clear the directory should contain the bin/qmake path and that in turn needs mkspecs/default/qmake.conf (on Windows) which you can verify by looking at Qt Creator code.

piotr.dobrogost
19th July 2009, 22:16
I don't know what you mean by "path of qt".
I meant path to qt installation.

When I compile qt in one folder and then move it somewhere else and set this new location of qt in creator I always get "is not a valid Qt directory" error. I think this shows that meeting criteria you mentioned is not enough for creator to treat some qt installation as valid. Do you agree?

wysota
19th July 2009, 23:23
Well, obviously it doesn't work, since you didn't tell qmake you moved the installation somewhere else. The question is why would you want to move the installation after compilation. If you know you need it elsewhere, use the -prefix switch to configure.

piotr.dobrogost
20th July 2009, 08:33
Well, obviously it doesn't work, since you didn't tell qmake you moved the installation somewhere else.

Do you remember me asking earlier about qmake not respecting environment variables and instead using compiled in path? You answered it uses its compiled in path only as a last resort if it can't tell where the qt is.
Can you tell me how could I inform qmake about current location of itself and the rest of qt framework so it doesn't use its compiled in and now wrong path?


The question is why would you want to move the installation after compilation.

Well, compiling something in the same place you are going to install it is not how it's supposed to be neither in *unix nor Windows not any other OS I think. That's why there's this magic make install step we all are used to.
Why is this step non-existent in case of qt?
Why after building I'm left with thousands of tmp files which are going to stay forever without install step?


If you know you need it elsewhere, use the -prefix switch to configure.

I was looking for it but guess what, it's not listed as an valid option in configure -help output.

wysota
20th July 2009, 08:52
Do you remember me asking earlier about qmake not respecting environment variables and instead using compiled in path? You answered it uses its compiled in path only as a last resort if it can't tell where the qt is.
The path points to the root of the installation, not to the detailed specs. That is picked up from the installation itself (the "default" subdirectory).


Can you tell me how could I inform qmake about current location of itself and the rest of qt framework so it doesn't use its compiled in and now wrong path?

Through -spec (strongest) or QMAKESPEC (weaker).


Why is this step non-existent in case of qt?
You are guessing, not stating, right? Well, in that case you are wrong in your guess.


Why after building I'm left with thousands of tmp files which are going to stay forever without install step?
Because you didn't run "make clean", I guess.

piotr.dobrogost
20th July 2009, 19:35
The path points to the root of the installation, not to the detailed specs. That is picked up from the installation itself (the "default" subdirectory).

The path doesn't point to the root of the installation but to the lib sub folder.

C:\Users\Piotr>qmake -v
QMake version 2.01a
Using Qt version 4.5.2 in C:\Qt\4.5.2-vc\lib



Through -spec (strongest) or QMAKESPEC (weaker).

To be able to use either of the above one has to know how to override the default value of the -spec option which creator shows in Projects/Build Settings/Build Steps/Effective qmake call. I had no idea where this value was taken from and couldn't find any information on this topic in documentation. If I missed something and this is documented somewhere please let me know. After reading your answers I took a look at /mkspecs/default and compared this with /mkspecs/win32-msvc2008. The only difference between them was this line

QMAKESPEC_ORIGINAL=C:/Qt/4.5.2-vc/mkspecs/win32-msvc2008
present in the former but absent from the latter. This value is taken by creator as the default value of -spec option. This variable is not even mentioned in qmake's manual at http://doc.qtsoftware.com/4.5/qmake-manual.html
How could I know what to change if there's no documentation on this?


You are guessing, not stating, right? Well, in that case you are wrong in your guess.

I'm not guessing but reading official qt document named Installing Qt on Windows (http://doc.qtsoftware.com/4.5/install-win.html) where there's nothing about installation step and nothing about make clean.
If I'm missing something please let me know.


Because you didn't run "make clean", I guess.

I didn't run it because when one is supposed to run
make clean it should be clearly written in documentation, right?

wysota
20th July 2009, 21:24
The path doesn't point to the root of the installation but to the lib sub folder.
I meant the "Qt path" in Creator, not qmake. I thought you did as well.


To be able to use either of the above one has to know how to override the default value of the -spec option which creator shows in Projects/Build Settings/Build Steps/Effective qmake call. I had no idea where this value was taken from and couldn't find any information on this topic in documentation.

I don't mean to be rude but I tried the first and most simple thing that crossed my mind (specifying the -spec parameter explicitely) and it worked and I'm sure one doesn't need to be a master mind to do the same. I don't think Qt documentation needs to clarify you have to actually have your computer turned on to be able to compile Qt applications. Am I wrong?


If I missed something and this is documented somewhere please let me know. After reading your answers I took a look at /mkspecs/default and compared this with /mkspecs/win32-msvc2008. The only difference between them was this line

QMAKESPEC_ORIGINAL=C:/Qt/4.5.2-vc/mkspecs/win32-msvc2008
present in the former but absent from the latter.
Congratulations! Finally!


This value is taken by creator as the default value of -spec option.
Yes, that's correct.


This variable is not even mentioned in qmake's manual at http://doc.qtsoftware.com/4.5/qmake-manual.html
Why should it be?


How could I know what to change if there's no documentation on this?
You shouldn't change it, that's the whole point... Things are sometimes not documented because you shouldn't be mendling with them. You are trying to do something completely the wrong way so don't be surprised you are encountering obstacles and things that are not documented.


I'm not guessing but reading official qt document named Installing Qt on Windows (http://doc.qtsoftware.com/4.5/install-win.html) where there's nothing about installation step and nothing about make clean.
Because the official way of installing Qt on Windows is an in-place installation. And also because of that at some point (Qt 4.3, as far as I remember) the -prefix parameter was removed from Windows version of configure. Again, you are trying to do something non-standard and encountering problems.


I didn't run it because when one is supposed to run
make clean it should be clearly written in documentation, right?

Does Qt documentation tell you (or should tell you) how to use the mouse or how to login to your computer? Why should Qt documentation include help about using make? Consult the make (or nmake) manual for this! There are rules for make considered standard and "clean" and "distclean" are examples of such. qmake implements them to be compliant with the standards but it doesn't have to document them because they are irrelevant for building Qt, its applications or anything else.

Using Qt assumes some degree of knowledge about computers, programming, compilers, C++, object-oriented programming and such. Qt is not for morons. Programming is not for morons. Not everybody needs to become a (decent) programmer. If one is not good enough for programming he can live a happy life as a luser bragging that he's good at computers because he knows how to align icons on Windows or think of himself as being a great h4x0r because he knows where to find a script that will break into some buggy cms software. Are we professionals or morons? Please, reader of this post, answer this question yourself (you can even post a reply here stating which is the case for you).

piotr.dobrogost
20th July 2009, 21:59
Using Qt assumes some degree of knowledge about computers, programming, compilers, C++, object-oriented programming and such. Qt is not for morons. Programming is not for morons.

I'm grieved to read the above. I think no one learning and asking questions deserves what you wrote. Nevertheless thank you very much for your time and help.

wysota
20th July 2009, 23:11
I'm grieved to read the above. I think no one learning and asking questions deserves what you wrote.

I think everyone does - if one manages to learn and at some point achieves a decent level of comprehension, he can say he's not among morons and can feel proud of himself. On the other hand if one doesn't manage to learn, it doesn't yet mean he's a moron. Although if one doesn't see he doesn't learn and despite being told he was doing things the wrong way he continues walking the Dark Path (C), that's different.

There is nothing wrong in asking questions - that's what this site is for. But if you don't learn from your mistakes and continue doing those same mistakes all over again and again, then something is wrong with you, not with the world around you. Despite what some people would like to think, we are not all equal - some are more talented in some directions than others and less gifted in other directions than others.

No matter how hard I try, I will never become a painter or a good (or even a bad) basketball player and there is nothing wrong in admitting that to the world. There are also people who no matter how hard they try, they will never be good programmers simply because their minds are not "wired" to that kind of thinking. There is nothing wrong in saying "I can't understand it" - it doesn't mean you never will understand something. If at first you don't succeed, try and try again - but do it the smart way! Don't be a moron, don't waste your time, there is a limited amount of it. I hope you can agree with that without grief.

Now take a look at this particular case of yours - you wanted to have Qt and Qt Creator in distinct paths in your system. Despite being told to download those two components as two separate packages that are suited for stand-alone installations at desired places, you have been struggling to divide Qt SDK - something that is a merge of the mentioned two packaes with purpose of having both components in the same place. Furthermore instead of building those packages as it is advised in respective pieces of documentation, you've been following the Dark Path that has led you astray and wasted hours of your time. Then instead of admitting your mistakes you have complained that this or that should have been mentioned here or there. You were advised to do something, however you have chosen your own path ("hey, I know better!") and when that led nowhere, you were surprised there had been no directions leading towards the Light.

But that's also my fault - I might have just kept my mouth shut instead of pointing the right path. I will know better next time, I don't intend to be a moron but instead I'm trying to learn from my mistakes.

piotr.dobrogost
21st July 2009, 08:39
Do you know what's the single most important characteristic of a programmer?

nish
21st July 2009, 08:50
Do you know what's the single most important characteristic of a programmer?

tell me please:)... i dont know much..

nish
21st July 2009, 08:52
I think everyone does - if one manages to learn and at some point achieves a decent level of comprehension, he can say he's not among morons and can feel proud of himself. On the other hand if one doesn't manage to learn, it doesn't yet mean he's a moron. Although if one doesn't see he doesn't learn and despite being told he was doing things the wrong way he continues walking the Dark Path (C), that's different.

There is nothing wrong in asking questions - that's what this site is for. But if you don't learn from your mistakes and continue doing those same mistakes all over again and again, then something is wrong with you, not with the world around you. Despite what some people would like to think, we are not all equal - some are more talented in some directions than others and less gifted in other directions than others.

No matter how hard I try, I will never become a painter or a good (or even a bad) basketball player and there is nothing wrong in admitting that to the world. There are also people who no matter how hard they try, they will never be good programmers simply because their minds are not "wired" to that kind of thinking. There is nothing wrong in saying "I can't understand it" - it doesn't mean you never will understand something. If at first you don't succeed, try and try again - but do it the smart way! Don't be a moron, don't waste your time, there is a limited amount of it. I hope you can agree with that without grief.

Now take a look at this particular case of yours - you wanted to have Qt and Qt Creator in distinct paths in your system. Despite being told to download those two components as two separate packages that are suited for stand-alone installations at desired places, you have been struggling to divide Qt SDK - something that is a merge of the mentioned two packaes with purpose of having both components in the same place. Furthermore instead of building those packages as it is advised in respective pieces of documentation, you've been following the Dark Path that has led you astray and wasted hours of your time. Then instead of admitting your mistakes you have complained that this or that should have been mentioned here or there. You were advised to do something, however you have chosen your own path ("hey, I know better!") and when that led nowhere, you were surprised there had been no directions leading towards the Light.

But that's also my fault - I might have just kept my mouth shut instead of pointing the right path. I will know better next time, I don't intend to be a moron but instead I'm trying to learn from my mistakes.



Don't be a moron, don't waste your time, there is a limited amount of it.

ahem... if you dont mind... can u tell us how much of your time did you wasted in writing this post..?? :)

piotr.dobrogost
24th July 2009, 13:01
Do you know what's the single most important characteristic of a programmer?

From what I see you are not curious of answer :)
Well, that's kind of funny because the characteristic I was asking about is CURIOSITY.

nish
25th July 2009, 02:00
From what I see you are not curious of answer :)
and how did you deduced this? may be i should have written "i am very curious for.....". Sorry my english is weak...:)



Well, that's kind of funny because the characteristic I was asking about is CURIOSITY.

whats more funny is when ppl think that they are the only smart ass walking around and other are a bunch of fool.

wysota
25th July 2009, 09:12
Well, that's kind of funny because the characteristic I was asking about is CURIOSITY.

Hmm... on what do you base that opinion (I completely disagree with it)?

piotr.dobrogost
25th July 2009, 21:55
and how did you deduced this?

The question was directed to wysota who hasn't answered and I was replaying to wysota not you.

piotr.dobrogost
25th July 2009, 21:58
Hmm... on what do you base that opinion (I completely disagree with it)?

On opinions of smart people and my own observations.

Lykurg
25th July 2009, 22:46
On opinions of smart people and my own observations.
Sorry, but that is too much for me, I have to interrupt. I don't know of whom you think, if you say someone is a smart person. Someone who says, that the curiosity is the programmers first characteristic, is definitely not such a person.

Curiosity is needed by scientist/researchers. A programmer is workman, he has to know this craft and the language which he use for that. He don't need any curiosity just knowledge. That's all. Some smartness is also quite good for him...

wysota
25th July 2009, 22:58
On opinions of smart people and my own observations.

One of my professors said that you could teach a monkey to be a programmer. And I completely second that opinion. Sorry, all you programmer guys out there (myself included)... Curiosity can be an attribute of software/architecture designer but too much curiosity of the programmer will only slow down the process of software development. The programmer should do as he is told and not ask (too many) questions. Using a parallel, a programmer needs to know how to use a hammer and not be skilled in bleeding-edge technologies related to techniques of constructing light and durable walls.

Self-development and research is an important aspect for every human and every computer specialist, programmers included. But it is not vital for being a good programmer. Knowing your programming language, toolchain and environemnt is. Curiosity is not required for that, thinking is.

nish
26th July 2009, 03:41
The question was directed to wysota who hasn't answered and I was replaying to wysota not you.
its time for our kid to learn a new basic of internet... This is a public forum..