PDA

View Full Version : Trouble building a sample (4.6)



Asperamanca
16th October 2009, 11:40
Dear all,

I've gotten stuck trying to build the AnimatedTiles sample from the 4.6 beta 1.
I am using qmake from the command line, then mingw32-make.

First thing is that qmake includes several paths into the INCPATH that don't belong there - paths to Visual Studio 6 include files. Those headers cause thousands of errors when trying to make the example. However, I am still using Visual Studio on the same machine, so I can't remove those paths from my "Include" environment variable.

Is there a way to tell qmake to ignore the Include environment variable, and use a different one instead? Preferrably something that I can set once, and not have to type in every time I run qmake on the command line?

Okay, so after manually removing those paths from my makefile, I come up with
"tmp/moc/debug_shared/main.moc:42: error: `rel_ops' has not been declared"

Since I assume the sample will compile fine when I build it correctly, I assume this again points to some configuration error in my build environment. Any hints where I might start to look?

high_flyer
16th October 2009, 12:35
how did you configure your Qt build?

Asperamanca
16th October 2009, 13:12
Good question. I didn't find a lot about configuring QT in the reference manual (only a bit in Installation). Since I am using QT Creator as well, my configuration might be from there, but to tell the truth, I have no idea.

Where do I find out more about how QT configuration works? Where/How is my own QT configuration stored? How can it be changed?
I have to add that my experience with C++ is about 10 years old, and back then, I had a visual IDE that would do most of the configuring for me. I didn't really have to work with makefiles and such back then, but this time I want to understand what's going on "under the hood", and not just rely on an IDE to do the work for me.

high_flyer
16th October 2009, 13:20
Good question.
Open the Qt command prompt, at the top you will see something like:
-- QMAKESPEC set to "win32-msvc2008" (for visual studio for example)

Where do I find out more about how QT configuration works?
one way would be to evoke "configure.exe --help" on the Qt command prompt under windows.
For Linux you can find more here:
http://doc.trolltech.com/4.5/qttools.html

Asperamanca
16th October 2009, 14:09
Open the Qt command prompt, at the top you will see something like:
-- QMAKESPEC set to "win32-msvc2008" (for visual studio for example)

As simple as that: I didn't know to use the specific QT command prompt! Now the sample compiles just fine! I've also tried out jom, and it works fine, too. THANKS!

Next step: Compiling the same example with QT Creator (1.3.0 beta). It seems the creator uses different build/path/environment settings, because the same example won't compile there.
How do I have to run QT Creator so it will use the same configuration as the QT command line?

high_flyer
16th October 2009, 14:51
How do I have to run QT Creator so it will use the same configuration as the QT command line?
Did you choose the correct Qt build in creator?

Asperamanca
16th October 2009, 15:05
Did you choose the correct Qt build in creator?

Tools->Options->Qt4->Default Qt Version: 4.6.0 beta
...if that's what you mean

If not, please specify. I'm still only starting to learn the lingo.

high_flyer
16th October 2009, 15:13
the whole thing sounds strange.
Did you install the SDK package for windows and installed that?
Did you install anything else?
Did you build qt your self?

Asperamanca
19th October 2009, 08:42
Yes, it seems strange.

More about my configuration, and the order of installation:

Windows XP SP3
Visual Studio 6

about two months ago, I installed
QT 4.5.2 SDK


A few days ago (after the QT developer days in Munich), I downloaded QT 4.6.0 beta 1, which includes MinGW. I uninstalled 4.5.2 and installed 4.6.0 beta 1
I also downloaded Creator 1.3.0 beta, and since that's only available in source, I built it using MinGW.
I then realized I might want to have an official SDK installed, and downloaded and installed 4.5.3 SDK, which includes Creator 1.2

Then came all the trouble on the command line. During that time, I tried JOM as an alternative to MinGW. I tried nmake before that, but it seems the Visual Studio 6 version is outdated, and can't compile certain stuff.

Then I fixed that command line trouble (THANKS!), but now still got error messages in Creator 1.3.0 beta.

This is my full output when building AnimatedTiles with command line (qmake and jom):


Setting up a MinGW/Qt only environment...
-- QTDIR set to F:\QT\4_6_0-beta1
-- PATH set to F:\QT\4_6_0-beta1\bin
-- Adding F:\QT\MinGW\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++

F:\QT\4_6_0-beta1\examples\animation\animatedtiles>qmake

F:\QT\4_6_0-beta1\examples\animation\animatedtiles>jom
jom 0.6.8 - empower your cores

F:\QT\4_6_0-beta1\bin\jom.exe -nologo -j 2 -f Makefile.Debug all
F:\QT\4_6_0-beta1\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 main.cpp -o tmp\moc\debug_shared\main.moc
f:\QT\4_6_0-beta1\bin\rcc.exe -name animatedtiles animatedtiles.qrc -o tmp\rcc\debug_shared\qrc_animatedtiles.cppg++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qrc_animatedtiles.o tmp\rcc\debug_shared\qrc_animatedtiles.cpp g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o main.cppg++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\animatedtiles.exe tmp/obj/debug_shared/main.o tmp/obj/debug_shared/qrc_animatedtiles.o -L"f:\QT\4_6_0-beta1\lib" -L"f:\QT\4_6_0-beta1\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
F:\QT\4_6_0-beta1\bin\jom.exe -nologo -j 2 -f Makefile.Release all
F:\QT\4_6_0-beta1\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 main.cpp -o tmp\moc\release_shared\main.moc
f:\QT\4_6_0-beta1\bin\rcc.exe -name animatedtiles animatedtiles.qrc -o tmp\rcc\release_shared\qrc_animatedtiles.cppg++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\qrc_animatedtiles.o tmp\rcc\release_shared\qrc_animatedtiles.cppg++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT-DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cppg++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\animatedtiles.exe tmp/obj/release_shared/main.o tmp/obj/release_shared/qrc_animatedtiles.o -L"f:\QT\4_6_0-beta1\lib" -L"f:\QT\4_6_0-beta1\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4


F:\QT\4_6_0-beta1\examples\animation\animatedtiles>

Asperamanca
19th October 2009, 08:43
In Creator 1.3.0 beta, I have the following project settings by default:


Effective qmake call:
qmake.exe F:/QT/4_6_0-beta1/examples/animation/animatedtiles/animatedtiles.pro -spec win32-msvc -r CONFIG+=release

Nothing special in the "Make" settings.

Result when building in Creator:

Compile output:

Running build steps for project animatedtiles...
Starting: f:\qt\4_6_0-beta1\bin\qmake.exe F:/QT/4_6_0-beta1/examples/animation/animatedtiles/animatedtiles.pro -spec win32-msvc -r CONFIG+=release
Exited with code 0.
Starting: F:/QT/4_6_0-beta1/bin/jom.exe
F:\QT\4_6_0-beta1\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-msvc" -D_MSC_VER=1200 -DWIN32 main.cpp -o tmp\moc\release_shared\main.moc
f:\QT\4_6_0-beta1\bin\rcc.exe -name animatedtiles animatedtiles.qrc -o tmp\rcc\release_shared\qrc_animatedtiles.cpp
cl -c -nologo -Zm200 -O1 -MD -GR -GX -W3 -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-msvc" -Fotmp\obj\release_shared\ @C:\DOCUME~1\vierob14\LOCALS~1\Temp\qrc_animatedti les.obj.1613890.jom
qrc_animatedtiles.cpp
cl -c -nologo -Zm200 -O1 -MD -GR -GX -W3 -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\release_shared" -I"..\..\..\mkspecs\win32-msvc" -Fotmp\obj\release_shared\ @C:\DOCUME~1\vierob14\LOCALS~1\Temp\main.obj.16145 93.jom
main.cpp
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(69) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(199) : error C2989: 'QConcatenable<char [0]>' : template class has already been defined as a non-template class
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(210) : error C2989: 'QConcatenable<char const [0]>' : template class has already been defined as a non-template class
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(249) : error C2989: 'QConcatenable<class QStringBuilder<T,`template-parameter258'> >' : template class has already been defined as a non-template class
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(249) : error C2988: unrecognizable template declaration/definition
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(252) : error C2039: 'type' : is not a member of 'QConcatenable<T>'
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(252) : error C2146: syntax error : missing ',' before identifier 'type'
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(252) : error C2065: 'type' : undeclared identifier
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(252) : error C2039: 'type' : is not a member of 'QConcatenable<`template-parameter258'>'
..\..\..\include\QtCore/../../src/corelib/tools/qstringbuilder.h(252) : error C2146: syntax error : missing ',' before identifier 'type'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(735) : error C2629: unexpected 'class QTouchEvent::TouchPoint ('
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(735) : error C2238: unexpected token(s) preceding ';'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(784) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(784) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(799) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(799) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(795) : error C2629: unexpected 'class QTouchEvent ('
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(795) : error C2238: unexpected token(s) preceding ';'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(805) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(811) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(817) : error C2027: use of undefined type 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/kernel/qevent.h(728) : see declaration of 'QTouchEvent'
..\..\..\include\QtGui/../../src/gui/image/qpixmap.h(287) : error C2667: 'qSwap' : none of 2 overload have a best conversion
..\..\..\include\QtGui/../../src/gui/image/qpixmap.h(287) : error C2668: 'qSwap' : ambiguous call to overloaded function
..\..\..\include\QtGui/../../src/gui/painting/qbrush.h(153) : error C2667: 'qSwap' : none of 2 overload have a best conversion
..\..\..\include\QtGui/../../src/gui/painting/qbrush.h(153) : error C2668: 'qSwap' : ambiguous call to overloaded function
..\..\..\include\QtGui\../../src/gui/image/qbitmap.h(88) : error C2667: 'qSwap' : none of 2 overload have a best conversion
..\..\..\include\QtGui\../../src/gui/image/qbitmap.h(88) : error C2668: 'qSwap' : ambiguous call to overloaded function
..\..\..\include\QtGui\../../src/gui/image/qpicture.h(121) : error C2667: 'qSwap' : none of 2 overload have a best conversion
..\..\..\include\QtGui\../../src/gui/image/qpicture.h(121) : error C2668: 'qSwap' : ambiguous call to overloaded function
command failed with exit code 2
F:\QT\4_6_0-beta1\bin\jom.exe -nologo -j 2 -f Makefile.Release all
jom 0.6.8 - empower your cores

command failed with exit code 2
Exited with code 2.
Error while building project animatedtiles
When executing build step 'Make'

...and tons of build issues (I don't know how to copy those, but in the vein of "use of undefined type QTouchEvent"

Default QT version is 4.6.0 beta

Asperamanca
19th October 2009, 10:06
I also tried building the sample in Creator 1.2.0 (using QT 4.6.0 beta again, since the sample won't work with an older QT version).

I noticed right away that the environment variables shown in "Project" - "Build Environment" are my regular system environment variables, not the ones from the QT command line. This is the case even if I start QTCreator from the QT command line.

So I tried checking the "Clean environment" boxes in both Debug and Release mode, and tried building the Debug mode first. I also replaced nmake with jom

Both qmake and then jom crashed.
QMake with the following call stack:

MSVCRT! 77c3f463()
QMAKE! 0047b7dc()
QMAKE! 00553708()
QMAKE! 005f54c2()
QMAKE! 005f4d21()
QMAKE! 00456167()
QMAKE! 00579624()
QMAKE! 00438726()
QMAKE! 00438b3e()
QMAKE! 0040124b()
QMAKE! 00401298()
KERNEL32! 7c817077()


jom without any debugging information at all.

(EDIT): When unchecking "Clean Environment", the behaviour is just like in Creator 1.3.0 beta. When checking "Clean Environment" in Creator 1.3.0 beta, qmake crashes, just like in 1.2.0.
So the Creator version does not seem to have anything to do with it (/EDIT)

Is there an article somewhere that describes in detail how to build yourself a clean QT environment (with multiple QT versions), even if you have other debuggers installed as well? I fully understand that my system isn't very cleanly installed, but as long as I don't know exactly what QT and Creator need and will use, I expect to run into trouble.

Other than that, is there a way to make Creator behave exactly as the QT command line, as far as building is concerned?

emu
21st October 2009, 06:44
Dood Visual Studio 6 that's like 10 years old.. good luck.

Asperamanca
21st October 2009, 08:55
Dood Visual Studio 6 that's like 10 years old.. good luck.

I'm not using it for QT...it's just installed...and needs to remain installed.