Hi...
I have a small problem using qtworkbench on windows (codeblocks is setup to use mingw). When I add additional libraries to my project and then compile the project, the compilation breaks complaining that the libraries could not be found. The reason is that for some reason the '\' in the path is not replaced by a '/'. This is done for all other paths when qmake creates the Makefile based on the .pro file. Since qmake creates the 'faulty' Makefile, I am not really sure if this i a bug in qmake or qtworkbench. I am using qt-4.3.1 at the moment.
How to reproduce:Project->build options->Search directories->linker
add a directories containing some dll
Project->build options->Linker settings
add some DLL base name.
OR
Porject->build options->Linker settings
add static library with absolute / relative path
Parts of my .pro file:
LIBS += -L"E:\programs\devel\GnuWin32\bin" -L"E:\programs\lib\FTGL-2.1.2\win32_vcpp\Build" -lfreetype6 -lftgl_dynamic_MT
INCLUDEPATH += E:\programs\lib\FTGL-2.1.2\include E:\programs\devel\GnuWin32\include E:\programs\devel\GnuWin32\include\freetype2
Parts of the resulting Makefile:
INCPATH = -I'e:/programs/lib/qt/4.3.1/include/QtCore' -I'e:/programs/lib/qt/4.3.1/include/QtCore' -I'e:/programs/lib/qt/4.3.1/include/QtGui' -I'e:/programs/lib/qt/4.3.1/include/QtGui' -I'e:/programs/lib/qt/4.3.1/include/QtOpenGL' -I'e:/programs/lib/qt/4.3.1/include/QtOpenGL' -I'e:/programs/lib/qt/4.3.1/include/QtXml' -I'e:/programs/lib/qt/4.3.1/include/QtXml' -I'e:/programs/lib/qt/4.3.1/include' -I'e:/programs/lib/FTGL-2.1.2/include' -I'e:/programs/devel/GnuWin32/include' -I'e:/programs/devel/GnuWin32/include/freetype2' -I'e:/programs/lib/qt/4.3.1/include/ActiveQt' -I'debug' -I'.' -I'e:/programs/lib/qt/4.3.1/mkspecs/default'
LIBS = -L'e:/programs/lib/qt/4.3.1/lib' -lopengl32 -lglu32 -lgdi32 -luser32 -LE:\programs\devel\GnuWin32\bin -LE:\programs\lib\FTGL-2.1.2\win32_vcpp\Build -lfreetype6 -lftgl_dynamic_MT -lQtXmld4 -lQtOpenGLd4 -lQtGuid4 -lQtCored4
Only the paths I added to 'Project build options->Search directories->Linker' (LIBS) are not converted from '\' to '/'. Paths I added to 'Search directories->Compiler' (INCLUDEPATH) are converted.
When I edit the makefile by hand, replacing all '\' by '/', and then call make from the command line (cmd.exe) it works. In the .pro file all paths contain '\' while in the Makefile all paths are converted to '/'. For some reason this is not done for a paths in the LIBS variable. qmake doesn't touch those paths at all, if I write '/' in the .pro file then it will be '/' in the Makefile, also. At the moment, it looks like a bug in qmake. On the other hand I didn't really looked at how qmake's is supposed to treat '/' vs. '\'.
I fixed this problem by hacking 'qtwprogenerator.cpp:425'. Instead of using UnixFilename(wxString) to replace the separator according to the platform (*nix/windows), I added the following lines:
wxString out = opts[x];
out.Replace(_T("\\"), _T("/"), true);
Other than this, version 0.6 of qtworkbench is working great...
thnx
Chriss