PDA

View Full Version : (Re-)Installing Qt / Problem with debugger



Computer Hater
29th April 2011, 12:01
Hi,

I installed Qt about half a year ago. Initially, I had installed Eclipse, Wascana, MSys, MinGW and Qt separately in a bit of a seesaw of reinstalls, but eventually settled on just installing the complete Qt SDK for Windows and no non-Qt tools. (I'm using Windows Vista Home Premium on a Laptop.)
I also accidentally *replaced* the contents of the Windows PATH variable during Qt installation with the Qt PATH instead of appending to it. I tried to fix this by doing a system restore, but it didn't change anything. The OS as well as Qt seemed to be working fine, so I let it go. I don't know if this is relevant.

I've since been working with this Qt installation without any problems, until a few days ago I ran into a problem that made me want to use the debugger for the first time.
When I tried to debug, I received the two error messages in the attached screenshot simultaneously.

At first I only looked at the main directory given ('C:\Develop\Qt\') which was the one I used in my early installations, whereas the current one only uses 'C:\Qt\2010.05\'. So I figured that the debugger was expected to be in an old installation path and therefore couldn't be found.
I then did a reinstall, this time also selecting the 'post-mortem debugger' option.

While doing the reinstall, I stumbled on another problem. In the installation instructions (http://doc.qt.nokia.com/4.7/install-win.html), it says:

>>
Step 4: Build the Qt Library

To configure the Qt library for your machine, type the following command in a Visual Studio command prompt:
C:
cd /D C:\Qt\4.7.2
configure
...
>>

But I don't have Visual Studio AFAIK and trying the above in a DOS Shell doesn't work as the 'configure' command is said to be unknown.
I've then been told that 'configure' is a Unix command and I vaguely remember typing this in the MSys Unix shell during the earlier installations, but I'm not sure anymore how or if I did this for the current installation of Qt that I've been using and that has been working so far.
Now I wanted to do this properly, but couldn't follow this instruction.

I then realized that the Qt installation still worked even though I didn't complete the instructions. However, the debugger problem still persists. (Actually, I only tried compiling for the 'Debug' version instead of the 'Release' version after the reinstall, but I don't suppose that changes anything.)
It seems a similar problem with the debugger was discussed here (http://www.qtcentre.org/threads/35204-Installing-QT-Creator-debugger-is-missing!).
But before I try anything else I would like to know how to run the 'configure' command under Windows to properly finish my reinstallation.

meazza
29th April 2011, 12:03
Oh sorry you wrote what operating system you have. Well I had this same problem on my computer which runs on windows 7. And I fixed with going in to options/debugger/gdb. There I removed the gdb-i686-pc-mingw32.exe from the list and added it again manually with just minGW checked when you get the dialog window.

It worked for me hopes it works for you

Computer Hater
29th April 2011, 14:55
Thank you for the response.
I did what you wrote and the debugger is starting now. (Actually, it was "Tools->Options->Debugger->gdb" - just for future reference.)

I am still worried about that 'configure' command though that I wasn't able to execute during installation (see original post). Nonetheless, the SDK seems to work.

However, when I run the program now, it crashes and I choose to debug, I then get the error shown in the top of the attached screenshot, saying that there is no gdb binary available. When I click on 'Settings', it opens up the settings menu where I added the gdb manually the way you described.
I'm not really sure what all this means. I guess I have to read up on the debugging section.

Another thing to note is that when I enter the settings menu this way, not doing anything, and then run the program again (as opposed to just clicking OK and running again), I get the second error message shown in the screenshot, along with the first one, saying that 'an instance' of something (probably Qt Creator) is already running.
I hope this is just a follow-up issue and will go away when the first problem is solved.

Edit:
The last paragraph seems to be obsolete. I noticed there was still officially a running instance of my program open in the 'Application Output' segment.

Computer Hater
30th April 2011, 18:57
So, questions still open:

1.) How do I run the 'configure' command when installing Qt (see post 1) ?
2.) What do I do about the first error message from post 3 (Adapter start failed - There is no gdb binary available for '<Unknown>') that appears when I enter the debugger during a crash when I run the compiled program ?

Computer Hater
30th April 2011, 23:16
A little update, if anyone is still reading:

Question 1) has been resolved. Apparently the installation instructions are a bit off. There is a 'configure' executable in a subdirectory called 'qt', not in Qt's main installation directory.

I also added both that directory's 'bin' subdirectory and MinGW's 'bin' directory to the PATH, so that my PATH looks like this:
c:\Qt\2010.05\qt\bin;c:\Qt\2010.05\mingw\bin

However, I then get the following output:

[..]
Do you accept the terms of the license?
y
All the required DirectShow/Direct3D files couldn't be found.
Make sure you have either the platform SDK AND the DirectShow SDK or the Windows
SDK installed.
If you have the DirectShow SDK installed, please make sure that you have run the
<path to SDK>\SetEnv.Cmd script.
vmr9.h not found
dshow.h not found
strmiids.lib not found
dmoguids.lib not found
msdmo.lib not found
d3d9.h not found
Environment:
INCLUDE=
Unset
LIB=
Unset
PATH=
c:/MinGW/bin
C:\Program Files\Common Files\Microsoft Shared\Windows Live
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
c:\Qt\4.7.0\bin
C:\Program Files (x86)\Silverfrost\FTN95 (PE 4.42.0.0)
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Program Files (x86)\Common Files\DivX Shared\
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Windows Live\Shared
c:\Qt\2010.05\qt\bin
c:\Qt\2010.05\mingw\bin
You are licensed to use this software under the terms of the GNU GPL version 3.Y
ou are licensed to use this software under the terms of the Lesser GNU LGPL vers
ion 2.1.
See C:/Qt/2010.05/qt3
or C:/Qt/2010.05/qtL

Configuration:
minimal-config
small-config
medium-config
large-config
full-config
build_all
debug
Qt Configuration:
release
debug
zlib
png
accessibility
qt3support
opengl
s60
ipv6
script
scripttools
xmlpatterns
multimedia
audio-backend
webkit
declarative
native-gestures
svg
minimal-config
small-config
medium-config
large-config
full-config

QMAKESPEC...................win32-msvc2010 (env)
Architecture................windows
Maketool....................nmake
Debug symbols...............yes
Link Time Code Generation...no
Accessibility support.......yes
STL support.................yes
Exception support...........yes
RTTI support................yes
MMX support.................yes
3DNOW support...............no
SSE support.................yes
SSE2 support................yes
IWMMXT support..............no
OpenGL support..............yes
OpenVG support..............no
OpenSSL support.............no
QtDBus support..............no
QtXmlPatterns support.......yes
Phonon support..............no
QtMultimedia support........yes
WebKit support..............yes
Declarative support.........yes
QtScript support............yes
QtScriptTools support.......yes
Graphics System.............raster
Qt3 compatibility...........yes

Third Party Libraries:
ZLIB support............qt
GIF support.............plugin
TIFF support............plugin
JPEG support............plugin
PNG support.............yes
MNG support.............plugin
FreeType support........no

Styles:
Windows.................yes
Windows XP..............no
Windows Vista...........no
Plastique...............yes
Cleanlooks..............yes
Motif...................yes
CDE.....................yes
Windows CE..............no
Windows Mobile..........no
S60.....................no

Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................plugin (qt)
SQLite2.................no
InterBase...............no

Sources are in..............C:\Qt\2010.05\qt
Build is done in............C:\Qt\2010.05\qt
Install prefix..............C:\Qt\2010.05\qt
Headers installed to........C:\Qt\2010.05\qt\include
Libraries installed to......C:\Qt\2010.05\qt\lib
Plugins installed to........C:\Qt\2010.05\qt\plugins
Imports installed to........C:\Qt\2010.05\qt\imports
Binaries installed to.......C:\Qt\2010.05\qt\bin
Docs installed to...........C:\Qt\2010.05\qt\doc
Data installed to...........C:\Qt\2010.05\qt
Translations installed to...C:\Qt\2010.05\qt\translations
Examples installed to.......C:\Qt\2010.05\qt\examples
Demos installed to..........C:\Qt\2010.05\qt\demos

Creating qmake...
execute: File or path is not found (nmake)
execute: File or path is not found (nmake)
Cleaning qmake failed, return code -1



I tried to follow up on the first problem reported and installed Windows' DirectX SDKs, first for 10.0 (which is the DirectX version I have), then for 9.0.
But that didn't change anything. So now I don't know what else to do.

Zlatomir
1st May 2011, 00:46
If you installed the SDK (judging by the path C:\Qt\2010.05\ - it seems you did) usually you don't need to configure and build (nmake or mingw-make) the Qt framework, since the SDK installs the already built framework you just start Qt Creator and start coding applications using the Qt framework.

//if you really want to build Qt framework take the easy way: download the source files and build that - or if you re-build the SDK - you can use distclean option for make to clean the old build before configure and make again, and if you use MinGW compiler the make will be mingw32-make not nmake (nmake is for Visual Studio)

But i recommend you stick with the SDK, you can download the 1.1 release candidate from here (http://developer.qt.nokia.com/prereleases).
I recommend you uninstall everything Qt related, delete the folder where you installed and tried to build Qt, remove the paths you added and install the SDK again - and this time don't try to configure and make.
//you can add the paths if you like to run your executable without copying the needed dll's in the same folder, but the dll copy will prepare you for the time when you will want to deploy your application on an system that doesn't have Qt installed ;)

Computer Hater
1st May 2011, 15:23
Thank you very much for the explanations, Zlatomir !
I never had a clear understanding of the different parts and steps. I probably still don't, but it's a bit better now.
Now it makes sense why I could use Qt Creator all those months even though I had never successfully run a 'configure' (let alone a 'make', which I didn't even notice).

Does that also explain all the error message I got when running 'configure' myself (in post 5) ? And can I just ignore them then ?

Yes, I had installed the SDK. But it was the "Qt SDK for Windows". Your link however is to the "QT SDK 1.1 RC".
Is there a difference ?

Now I uninstalled my installation and installed the "SDK 1.1 RC" as you said, but I get the following message when compiling my program:

>>
Could not find make command: make in the build environment
Error while building project SiKat (target: Desktop)
When executing build step 'Make'
>>

Did I miss something ?
Should I go back to the "SDK for Windows" ?
At least the compiler worked then.

I'm confused. I have read so many instructions on how to install Qt and asked different people and no two answers are the same. And no way seems to work properly.
I really need help getting this environment running for a start. :-(

Zlatomir
1st May 2011, 15:50
The 1.1 RC (the one from the link i gave) is:
1) a newer version of the SDK (it contains Qt 4.7.3)
2) it gives you the option to install the SDK for Symbian and Maemo
3) it gives the option to install the binaries for Visual Studio 2008 or 2005.

As for your problem with make command - make sure you installed MinGW (when you installed the SDK MinGW compiler was selected? the one from Miscellaneous - MinGW 4.4 - this one install the MinGW compiler)

If you installed the SDK with MinGW and still get the error message it is possible that you need to "tweak" Creator a little bit - the install-uninstall-failed_build could be messed some things.
So: open Creator and open a project, then:
- go to the Projects button (from the left bar)
- at General you will see Qt Version - make sure that Qt 4.7.3 for Desktop is selected - and if it isn't selected then select it.
If isn't present then click manage and add the Qt version, call it Qt4.7.3 and then select the path to qmake, by default that will be something like: C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe
- at Build Steps you have Qmake and Make, i guess here is the issue - if the make isn't found (make sure you installed MinGW with the SDK) and select the path to MinGW make executable, by default the path is something like: C:\QtSDK\mingw\bin\mingw32-make.exe

Computer Hater
1st May 2011, 17:03
Zlatomir,
thank you again so much for this clear and to-the-point answer. :b

The problem was in fact that no valid Qt version had been selected. It does compile now after selecting "Qt 4.7.3 for Desktop - MinGW 4.4 (Qt SDK)".
I wonder though if I should care about all the other seemingly obsolete Qt Version entries. They are: "Qt in PATH" and two times (!) "4.7.0". Do you think I should somehow remove those other entries ?

One more thing has changed and I don't know if it's a good thing:
When I run my program and it crashes (it still has that bug), the Windows message that appears doesn't offer me to jump directly into the debugger (which would be 'post-mortem' debugging, I suppose). As a consequence, the related problems that I described in post 3 don't appear.
But I suppose then I simply use the debugger non-post-mortem by calling it directly (which appears to work) ?

So, if the current situation doesn't require any more fixes, then I suppose I just need to read up on the debugger and I can work on. :b

Also, I would like to ask if there is anywhere I can read up on all these terms and functionalities surrounding setting up the work environment, such as makefiles, building, cleaning, etc.
I have a bit of programming experience, but virtually none with all this background stuff.
Is there anywhere you can point me to that gives an easy introduction into this topic ?

Again, thank you so much. It appears the installation / debugging problem is solved and I can now continue the actual work. :b