PDA

View Full Version : Hehe, Cant Compile tutorial 8



Reenen
8th February 2006, 14:34
Hi again!

Ok, so I tried
qmake -project
qmake
make

but this is what I get... and I am totally lost. This is the compiler errors:



mingw32-make -f Makefile.Release
Makefile.Release:114: warning: overriding commands for target `release\moc_Cannonfield.cpp'
Makefile.Release:108: warning: ignoring old commands for target `release\moc_Cannonfield.cpp'
Makefile.Release:148: warning: overriding commands for target `release\moc_Cannonfield.o'
Makefile.Release:142: warning: ignoring old commands for target `release\moc_Cannonfield.o'
mingw32-make[1]: Entering directory `C:/Projects/QTPROJ~1/Tut1'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQ
T_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt
/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"
." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\Cannonfield.o Cannonfield.cpp
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQ
T_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt
/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"
." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\lcdrange.o lcdrange.cpp
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQ
T_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt
/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"
." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\main.o main.cpp
C:\Qt\4.1.0\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CO
RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/Qt
Gui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.0
/mkspecs/win32-g++" -D__GNUC__ -DWIN32 cannonfield.h -o release\moc_cannonfield.cpp
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQ
T_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt
/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"
." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\moc_cannonfield.o release\moc_cannonfield.cpp
C:\Qt\4.1.0\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CO
RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/Qt
Gui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"." -I"C:/Qt/4.1.0
/mkspecs/win32-g++" -D__GNUC__ -DWIN32 lcdrange.h -o release\moc_lcdrange.cpp
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQ
T_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt
/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include" -I"." -I"C:/Qt/4.1.0/include/ActiveQt" -I"release" -I"
." -I"C:/Qt/4.1.0/mkspecs/win32-g++" -o release\moc_lcdrange.o release\moc_lcdrange.cpp
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl
,-s -Wl,-s -Wl,-subsystem,windows -o "release\Tut1.exe" release\Cannonfield.o release\lcdrange.o rel
ease\main.o release\moc_Cannonfield.o release\moc_lcdrange.o release\moc_cannonfield.o -L"C:\Qt\4.1
.0\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCore4
release\moc_cannonfield.o:moc_cannonfield.cpp:(.te xt+0x0): multiple definition of `CannonField::meta
Object() const'
release\moc_Cannonfield.o:moc_cannonfield.cpp:(.te xt+0x0): first defined here
release\moc_cannonfield.o:moc_cannonfield.cpp:(.te xt+0x10): multiple definition of `CannonField::qt_
metacast(char const*)'
release\moc_Cannonfield.o:moc_cannonfield.cpp:(.te xt+0x10): first defined here
release\moc_cannonfield.o:moc_cannonfield.cpp:(.te xt+0xa0): multiple definition of `CannonField::qt_
metacall(QMetaObject::Call, int, void**)'
release\moc_Cannonfield.o:moc_cannonfield.cpp:(.te xt+0xa0): first defined here
release\moc_cannonfield.o:moc_cannonfield.cpp:(.te xt+0x60): multiple definition of `CannonField::ang
leChanged(int)'
release\moc_Cannonfield.o:moc_cannonfield.cpp:(.te xt+0x60): first defined here
release\moc_cannonfield.o:moc_cannonfield.cpp:(.da ta+0x0): multiple definition of `CannonField::stat
icMetaObject'
release\moc_Cannonfield.o:moc_cannonfield.cpp:(.da ta+0x0): first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\Tut1.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Projects/QTPROJ~1/Tut1'
mingw32-make: *** [release] Error 2


(I use tut1 for every tut so far... I may want to create new projects now)

jacek
8th February 2006, 14:52
Don't overuse "qmake -project". You should run it at most once, to create an initial .pro file for your project. If you call it later you can run into troubles as it scans directories recursively for any files that look like C++ sources.

Judging from the errors, it looks like your .pro file contains too much entries. Open it with a text editor and remove all automatically generated files from HEADERS and SOURCES variables. Then run "qmake" and "make".