Moc errors in Hello World program (Qt 3.2.1)

  • Hello All,
    I am new to QT and I am following a book,C++ GUI with QT3. I have QT 3.2.1. I am on first example Hello Qt! and I got followin error message when I run make. It's on openSuse 13.1.

    linux-d0oe:/usr/local/qt-x11-free-3.2.1/tutorial/hello # make
    /usr/local/qt-x11-free-3.2.1/bin/moc -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/qt-x11-free-3.2.1/include/QtCore -I/usr/local/qt-x11-free-3.2.1/include/QtGui -I../../include -I. -I.moc/release-shared ../../src/kernel/qapplication.h -o .moc/release-shared/moc_qapplication.cpp
    Qt meta object compiler
    moc: Invalid argument
    Usage: moc [options] <header-file>
    -o file Write output to file rather than stdout
    -i Do not generate an #include statement
    -f[file] Force #include, optional file name
    -p path Path prefix for included file
    -k Do not stop on errors
    -nw Do not display warnings
    -v Display version of moc
    make: *** [.moc/release-shared/moc_qapplication.cpp] Error 1

    PS I really need help on this.

  • nealthwin Please start new thread with you question.
    I suggest you to use the latest (5.2.1) version of Qt.
    You can download it "here":

    EDIT: I have split this out into a new thread --JKSH

  • Moderators

    Hi nealthwin,

    [quote]-I/usr/share/qt4/mkspecs/linux-g++[/quote]Your system is trying to mix Qt 3 and Qt 4. You cannot mix versions.

    How did you install Qt? What is the title of the book?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.