PDA

View Full Version : Qt Creator only builds the Release version!



Verse
7th January 2010, 09:32
Installation: Qt 4.6.0 (Mingw) built Nov 27 2009 (LGPL)

I installed it, did the tutorial for TextFinder and I am having some real build issues.

The default build configuration is Debug. The build is green but when Qt Creator tries to run the TextFinder app I get...


Starting H:\Cookbook\qt\text_finder\debug\text_finder.exe.. .
The process could not be started!


Looking at the actual directory, I find that the \debug directory is empty but that there is a text_finder.exe in the \release directory. Running that .exe yields an error message box - "text_finder.exe - Entry Point Not Found"...


The procedure entry poin _Z21qRegisterResourceDataiPKhS0_S0_ could not be located in the dynamic link library QtCore4.dll


So, I switched the build configuration to Release, and everything builds and runs just fine.

Switching back to Debug and examining the compile output reveals that even though I have selected the debug configuration the Makefile.release is still being used to build the project, here is the output of a rebuild with the Debug configuration...


Running build steps for project text_finder...
Starting: C:/Qt/2009.05/mingw/bin/mingw32-make.exe clean -w
mingw32-make: Entering directory `H:/Cookbook/qt/text_finder'
C:/Qt/2009.05/mingw/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory `H:/Cookbook/qt/text_finder'
rm tmp/moc/release_shared/moc_textfinder.cpp
rm release/qrc_textfinder.cpp
rm ui_textfinder.h
rm tmp/obj/release_shared/main.o tmp/obj/release_shared/textfinder.o tmp/obj/release_shared/moc_textfinder.o tmp/obj/release_shared/qrc_textfinder.o
mingw32-make[1]: Leaving directory `H:/Cookbook/qt/text_finder'
C:/Qt/2009.05/mingw/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory `H:/Cookbook/qt/text_finder'
rm tmp/moc/debug_shared/moc_textfinder.cpp
rm debug/qrc_textfinder.cpp
rm ui_textfinder.h
rm: cannot remove `ui_textfinder.h': No such file or directory
rm tmp/obj/debug_shared/main.o tmp/obj/debug_shared/textfinder.o tmp/obj/debug_shared/moc_textfinder.o tmp/obj/debug_shared/qrc_textfinder.o
mingw32-make[1]: [compiler_uic_clean] Error 1 (ignored)
mingw32-make[1]: Leaving directory `H:/Cookbook/qt/text_finder'
mingw32-make: Leaving directory `H:/Cookbook/qt/text_finder'
Exited with code 0.
Configuration unchanged, skipping QMake step.
Starting: C:/Qt/2009.05/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `H:/Cookbook/qt/text_finder'
C:/Qt/2009.05/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `H:/Cookbook/qt/text_finder'
c:/Qt/2009.05/qt/bin/uic.exe textfinder.ui -o ui_textfinder.h
g++ -c -O2 -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/Qt/2009.05/qt/include/QtCore' -I'c:/Qt/2009.05/qt/include/QtGui' -I'c:/Qt/2009.05/qt/include' -I'c:/Qt/2009.05/qt/include/ActiveQt' -I'tmp/moc/release_shared' -I'.' -I'c:/Qt/2009.05/qt/mkspecs/win32-g++' -o tmp/obj/release_shared/main.o main.cpp
g++ -c -O2 -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/Qt/2009.05/qt/include/QtCore' -I'c:/Qt/2009.05/qt/include/QtGui' -I'c:/Qt/2009.05/qt/include' -I'c:/Qt/2009.05/qt/include/ActiveQt' -I'tmp/moc/release_shared' -I'.' -I'c:/Qt/2009.05/qt/mkspecs/win32-g++' -o tmp/obj/release_shared/textfinder.o textfinder.cpp
C:/Qt/2009.05/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/Qt/2009.05/qt/include/QtCore' -I'c:/Qt/2009.05/qt/include/QtGui' -I'c:/Qt/2009.05/qt/include' -I'c:/Qt/2009.05/qt/include/ActiveQt' -I'tmp/moc/release_shared' -I'.' -I'c:/Qt/2009.05/qt/mkspecs/win32-g++' -D__GNUC__ -DWIN32 textfinder.h -o tmp/moc/release_shared/moc_textfinder.cpp
g++ -c -O2 -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/Qt/2009.05/qt/include/QtCore' -I'c:/Qt/2009.05/qt/include/QtGui' -I'c:/Qt/2009.05/qt/include' -I'c:/Qt/2009.05/qt/include/ActiveQt' -I'tmp/moc/release_shared' -I'.' -I'c:/Qt/2009.05/qt/mkspecs/win32-g++' -o tmp/obj/release_shared/moc_textfinder.o tmp/moc/release_shared/moc_textfinder.cpp
c:/Qt/2009.05/qt/bin/rcc.exe -name textfinder textfinder.qrc -o release/qrc_textfinder.cpp
g++ -c -O2 -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/Qt/2009.05/qt/include/QtCore' -I'c:/Qt/2009.05/qt/include/QtGui' -I'c:/Qt/2009.05/qt/include' -I'c:/Qt/2009.05/qt/include/ActiveQt' -I'tmp/moc/release_shared' -I'.' -I'c:/Qt/2009.05/qt/mkspecs/win32-g++' -o tmp/obj/release_shared/qrc_textfinder.o release/qrc_textfinder.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-subsystem,windows -o release/text_finder.exe tmp/obj/release_shared/main.o tmp/obj/release_shared/textfinder.o tmp/obj/release_shared/moc_textfinder.o tmp/obj/release_shared/qrc_textfinder.o -L'h:/cookbook/Qt/lib' -L'c:/Qt/2009.05/qt/lib' -lmingw32 -lqtmain -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `H:/Cookbook/qt/text_finder'
mingw32-make: Leaving directory `H:/Cookbook/qt/text_finder'
Exited with code 0.


I have other, commercial, installations of Qt installed (and usually have no problems with them but they are for VS2005), I also already have Mingw and Msys already installed and on my path.

Any ideas?

wysota
7th January 2010, 10:07
Do you have debug versions of Qt libraries (they should have a "d" character appended to their name)?

Verse
7th January 2010, 14:10
I think so, the DLLs look like this...

./qt/bin/QtCore4.dll
./qt/bin/QtCored4.dll
./qt/bin/QtGui4.dll
./qt/bin/QtGuid4.dll
etc...

So, I assume that those with the extra 'd' are the debug versions.

wysota
7th January 2010, 15:19
Create a (new) minimal project containing only the main() function and see if you can build it in release mode.

Verse
7th January 2010, 17:02
Created a minimalist 'Hello World' main.cpp - same issue. However, I can build from the command line with "make release" or "make debug" and that works fine.

wysota
7th January 2010, 18:25
Please post your qmake project file of the minimal example.

Verse
12th January 2010, 08:38
I have attached a tar.gz of the project, plus the generated makefiles.

-Verse