This is a very short tutorial on how to setup Qt Creator on Windows as your debugging environment for Photivo. It is based on Qt Creator 2.3 and assumes you are familiar with compiling Photivo on Windows and have setup your toolchain as explained there.
You actually can run the debugger with some non-debug dependencies and most likely that will work fine as long as you only use those parts of Photivo that don’t rely on those dependencies. In my experience a segfault happens when Photivo with the debugger attached tries to access a non-debug dependency. Example: Debugging with a non-debug lensfun DLL will work as long as you do not actually use the lensfun tools. Effectively this means you must compile a debug version of at least Qt. Debug versions of the other libs might or might not be necessary.
qmake.exe
.g++.exe
. Qt Creator will try to automatically set Debugger and ABI accordingly. Make sure the debugger is C:\tc\MinGW32\bin\gdb-python27.exe
. (This Python enabled debugger crashes for me with the TDM 4.6.1 toolchain and Qt Creator 2.4.1. The non-python version gdb.exe
seems to work with Qt Creator 2.5 beta, despire an error message about missing “Qt debugging helpers”.)photivoProject.pro
. When the Project Setup dialog appears make sure Use Shadow Building is checked and you have an entry for release and debug version. Photivo’s Mercurial repository is configured to ignore paths starting with “build”, so it’s a good idea to choose names accordingly.C:\tc\MinGW32\msys\bin\make.exe
) is known to work. I had problems with the one from MinGW (that Qt selects by default) and multicore compiling.make
for your CPU cores, i.e. in Make arguments enter -j2
for a dual-core CPU, -j4
for a quad-core CPU etc.bin
folders to the PATH
variable. Those are:LDFLAGS
and set it to -LC:/tc/MinGW32/my/lib
(forward slashes!)CFLAGS
and set it to -IC:/tc/MinGW32/my/include
(forward slashes!)CXXFLAGS
and set it to -IC:/tc/MinGW32/my/include
(forward slashes!)PKG_CONFIG_PATH
and set it to C:/tc/MinGW32/my/lib/pkgconfig
(forward slashes!)Assuming your MinGW toolchain is correct and you successfully built all dependencies debugging should work now.
libwinpthread-1.dll
into qt\bin folder.
When compiling via pure MinGW without Msys – as is the case in Qt Creator – make does not recognise the -j
switch properly, i.e. compiling is single-threaded and slow. You can solve this in Creator’s Build Environment settings (see above). Define
MAKE_COMMAND=mingw32-make -j4
and you’re good. Instead of 4
use your number of processor cores.