Please help me get started with debugging in Qt Creator
-
wrote on 6 May 2014, 13:49 last edited by
Can someone please help me get started with debugging in Qt Creator. My compiler is MinGW 4.8 32bit. In Options > Build & Run, Debugger tab it says "Extracted from Kit Desktop Qt 5.2.1 MinGW 32bit C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\gdb.exe.
When I add a breakpoint, there is an hourglass next to it. When I "Start Debugging" the hourglass goes away. Execution does not stop on my breakpoints. What is my problem?
Thanks a lot
Ron -
wrote on 6 May 2014, 14:07 last edited by
Have you built your application in Debug mode?
-
wrote on 6 May 2014, 15:07 last edited by
On the left side of the screen, I changed from Release to Debug, then clicked Compile, and I get the error: cannot find -lcbw32d
This is trying to use the debug version of a library that I installed. There is no debug version. I looked back on an answer from SGaist where he said "If you only have a release library, remove the line from the pro file that tries to link to the debug version." I did this but no change.
How do I get rid of this error?
Is there not any way to look at the libraries you have already added? Do you just have to look in the .pro file?Thanks
Ron -
wrote on 6 May 2014, 15:42 last edited by
Could you show did you add cbw32 to .pro file.
-
wrote on 6 May 2014, 15:47 last edited by
Not sure what you are asking, andreyc, but here is what I have in the .pro file:
@#---Following added when DAQ library was added---
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../DAQ_C/ -lcbw32
#else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../DAQ_C/ -lcbw32dINCLUDEPATH += $$PWD/../DAQ_C
DEPENDPATH += $$PWD/../DAQ_C
#------------------------------------------------
@
Ron -
wrote on 6 May 2014, 16:25 last edited by
If you only have a release version of that library, I would just write
@ LIBS += -L$$PWD/../DAQ_C/ -lcbw32@ -
wrote on 6 May 2014, 18:16 last edited by
I got it working now. I think my main problem was that in Projects mode -> Build Settings -> Debug, I had a Build directory that was invalid. I set my build directories for Release & Debug to folders outside of my project folder (I don't like this), i.e. "build-GaugeMon-Desktop_Qt_5_2_1_MinGW_32bit-Debug" and checked the Shadow build checkbox.
Thanks for your help.
Ron -
wrote on 6 May 2014, 20:32 last edited by
I ended up having to use Asperamanca's line for the library, in the .pro file:
@LIBS += -L$$PWD/../DAQ_C/ -lcbw32@
6/8