PDA

View Full Version : Mingw integration



graham.labdon
24th March 2009, 14:40
Hello
Please can you help me?
I am using Qt Eclipse integration but cannot get to debug an application
WHen I try I get the following error from the debugger

You can't do that without a process to debug

Does anyone know what this means?

lyuts
24th March 2009, 14:57
It means that your mingw installation doesn't have gdb in it. You need to download install gdb for win32 (You didn't mention, so i assume that you are on windows).

graham.labdon
24th March 2009, 15:00
I am on windows
I have gdb under the mingw folder in the Qt folder.

If I remove references to Qt objects in my program I can run the debbuger. As soon as I put in the line QCoreApplication a(argc, argv); I can no longer debug

Any other ideas?

Graham

Lawand
24th March 2009, 22:49
Check this tutorial (http://www.qtcentre.org/forum/f-installation-and-deployment-5/t-a-guide-to-install-mingw-qt4-and-eclipse-integration-on-windows-xp-13362.html), and make sure you apply step 9.

graham.labdon
25th March 2009, 10:05
Hi
THanks for the reply
I am using QT SDK by Nokia v2009.01 which includes mingw
I ahve set uo the environment as in the tutorial but still cannot debug. I cannot now get the program to run either.
Please help, i am tearing my hair out!!

Graham

Lawand
25th March 2009, 10:25
Well, I am using the same version "Qt SDK by Nokia v2009.01" with eclipse and everything is working OK.
how about telling you all the steps that I did from scratch to install Qt+Eclipse?

graham.labdon
25th March 2009, 10:29
That would good - thanks
Graham

Lawand
25th March 2009, 10:56
First of all, remove everything you already have (Qt SDK, eclipse, MinGW, any edits to environment Variable(s), etc. )

Now follow these steps:

Download and unpack Eclipse IDE for C/C++ Developers (http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR2/eclipse-cpp-ganymede-SR2-win32.zip) to C:\eclipse
Download and run the Automated MinGW Installer (http://downloads.sourceforge.net/mingw/MinGW-5.1.4.exe), and don't forget to select (in addition to MinGW Tools), MinGW Make and the G++ compiler and install in the default path
Download and install the GDB (http://downloads.sourceforge.net/mingw/gdb-5.2.1-1.exe), keeping all options default
Download and install MSYS (http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe) again keeping all options default, and when the installation ends, you'll see a prompt (in a command line window) then choose yes twice then enter this string as is: c:/mingw
Prepend (Not Append) C:\msys\1.0\bin;C:\mingw\bin; to the PATH Environment Variable
Download and install Qt SDK (http://get.qtsoftware.com/qtsdk/qt-sdk-win-opensource-2009.01.exe) also in the default directory.
Download and install Qt Eclipse Integration for C++ (http://dist.trolltech.com/developer/download/qt-eclipse-integration-win32-1.5.0.exe), all default :)
Append ;C:\Qt\2009.01\qt\bin to the PATH Environment Variable
Add C:\MinGW\lib;C:\Qt\2009.01\qt\lib to the Lib Environment Variable (if no Lib, please create one)
Add C:\MinGW\include;C:\Qt\2009.01\qt\include to the Include Environment Variable (if no Include, please create one)
Open eclipse and goto: "Preferences -> Qt -> Add", then give these values:

Version Name: 4.5.0
Bin Path: C:\Qt\2009.01\qt\bin
Include Path: C:\Qt\2009.01\qt\include

Reboot your computer
Click the bug icon and select "Debug Configurations", add a new configuration in C/C++ Local Application, notice that C/C++ Application should be "debug/*.exe", not "release/*.exe"! Choose the Debugger tab and set Debugger to gdb/mi. And then choose apply.


And, you're done ( finally :) )
HTH

graham.labdon
25th March 2009, 12:57
hello again
I have followed the instructions but still hanve problems
I created a simple application and when I run it or debug it it terminates immediately
the following is the output from gdb. Have you any idea what is goin on?


33-gdb-set confirm off
33^done
(gdb)
34-gdb-set width 0
34^done
(gdb)
35-gdb-set height 0
35^done
(gdb)
36-interpreter-exec console echo
36^error,msg="Undefined MI command: interpreter-exec"
(gdb)
37-gdb-show prompt
37^done,value="(gdb) "
(gdb)
38
&"\n"
38^done
(gdb)
39-gdb-set stop-on-solib-events 0
39^done
(gdb)
40-gdb-set stop-on-solib-events 1
40^done
(gdb)
41-gdb-set new-console off
41^done
(gdb)
42-environment-cd C:\\workspace\\TestQt
42^done
(gdb)

43-environment-directory C:/workspace/TestQt C:/workspace/TestQt/debug C:/workspace/TestQt/release
43^done
(gdb)
44 info threads
&"info threads\n"
&"No stack.\n"
44^error,msg="No stack."
(gdb)
45-data-list-register-names
45^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","eflags","cs","ss","ds","es","fs","gs","st0","st1","st2","st3","st4","st5","st6","st7","fctrl","fstat","ftag","fiseg","fioff","foseg","fooff","fop"]
(gdb)
46-break-insert -t main
46^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00401305",func="main",file="main.cpp",line="10",times="0"}
(gdb)
47-exec-run
47^running
(gdb)
48-gdb-exit

graham.labdon
25th March 2009, 13:12
hello again
I have followed the instructions but still hanve problems
I created a simple application and when I run it or debug it it terminates immediately
the following is the output from gdb. Have you any idea what is goin on?


33-gdb-set confirm off
33^done
(gdb)
34-gdb-set width 0
34^done
(gdb)
35-gdb-set height 0
35^done
(gdb)
36-interpreter-exec console echo
36^error,msg="Undefined MI command: interpreter-exec"
(gdb)
37-gdb-show prompt
37^done,value="(gdb) "
(gdb)
38
&"\n"
38^done
(gdb)
39-gdb-set stop-on-solib-events 0
39^done
(gdb)
40-gdb-set stop-on-solib-events 1
40^done
(gdb)
41-gdb-set new-console off
41^done
(gdb)
42-environment-cd C:\\workspace\\TestQt
42^done
(gdb)

43-environment-directory C:/workspace/TestQt C:/workspace/TestQt/debug C:/workspace/TestQt/release
43^done
(gdb)
44 info threads
&"info threads\n"
&"No stack.\n"
44^error,msg="No stack."
(gdb)
45-data-list-register-names
45^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","eflags","cs","ss","ds","es","fs","gs","st0","st1","st2","st3","st4","st5","st6","st7","fctrl","fstat","ftag","fiseg","fioff","foseg","fooff","fop"]
(gdb)
46-break-insert -t main
46^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00401305",func="main",file="main.cpp",line="10",times="0"}
(gdb)
47-exec-run
47^running
(gdb)
48-gdb-exit

graham.labdon
25th March 2009, 13:45
OK I solved it - you need to set the Qt version in the Qt section of project properties

Thanks for your help

Graham

Lawand
26th March 2009, 13:10
I mentioned that you should setup Qt version (step 9)...

Anyway, Good for you.