Results 1 to 2 of 2

Thread: Hehe, Cant Compile tutorial 8

  1. #1
    Join Date
    Feb 2006
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Hehe, Cant Compile tutorial 8

    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)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Hehe, Cant Compile tutorial 8

    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".

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  3. Can't Compile Tutorial 7
    By Reenen in forum Newbie
    Replies: 10
    Last Post: 9th February 2006, 14:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.