Problems using Qt with Visual Studio 2008 Express Edition
-
I have a project that is using Qt with Visual Studio 2008 Express Edition. Qt comes with it's own build tool (qmake) which outputs a makefile for VS to use. So i do not actually use any build settings in VS's project properties, i just set nmake to use the makefile. But i am having a few problems with this. Firstly, whenever i run the project (F5) it says that it's out if date and asks me to re-build. This always happens, even if i have just built it a second ago. I don't know if anyone knows how to use Qt's build tools but i suspect this is more to do with the makefile that it generates, and so would be VS's problem. How do i get VS to pick up that the files are up-to-date? And how does it work, anyway? The second problem (maybe not related to Qt) is to do with the resource (.rc) file. I define the application's version number in a header file and #include it in the resource file and used in the VS_VERSION_INFO. But when i change the header file, VS will re-compile every source file that includes it (most of the files in my project) but not the resource file. How can i force it to compile it either when it's changes or, failing that, all the time? Finally (this does seem Qt related), i put my executable and data files in a folder one level above my source files. Like this: app.exe other files src/ project file and others Release/ this is where the exe is output to Debug/ and here in debug I should just be able to change the output directory from $(SolutionDir)/src/Release to $(SolutionDir)/. But if do that, it also dumps intermediate .lib and .pdb files there too (which should stay in the Release or Debug folders. To get around this small yet annoying problem, i have had to use a custom build step which copies the file. If it helps, here is my Qt project file: # This is the project file for Qt. # It is used for the Qt pre-processor, qmake TEMPLATE = app CONFIG += windows uitools # Output exe to release or debug folder, then copy to project's root dir CONFIG(release, debug|release) { DESTDIR = Release } else { DESTDIR = Debug } QMAKE_POST_LINK += xcopy \"$${DESTDIR}\\$${TARGET}.exe\" \"$${DESTDIR}\\..\\..\" /Y HEADERS = header files here SOURCES = source files here FORMS = forms/*.ui UI_DIR = forms TRANSLATIONS = translation files here # Setting UI_DIR seems to change the compiler's working directory, me