Results 1 to 4 of 4

Thread: Compile Errors

  1. #1
    Join Date
    Nov 2006
    Posts
    58
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Compile Errors

    I downloaded a app which is a simple calculator. But when I try to compile it and run it on my own machine there showed many errors.
    And the way i compile the app is :
    1. qmake -project
    2. qmake
    3. make
    My Qt version is 3.3.3. I don't know where is the problem or what is the right way to compile and run the app. I be totally a fresh man with Qt.
    please HELP me .Thanks.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compile Errors

    Can you post the errors that you are getting?

  3. #3
    Join Date
    Nov 2006
    Posts
    58
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Compile Errors

    Quote Originally Posted by munna View Post
    Can you post the errors that you are getting?
    Here is the errors:

    g++ -c -pipe -Wall -W -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt-3.3/mkspecs/default -I. -I. -I/usr/lib/qt-3.3/include -o main.o main.cpp
    In file included from main.cpp:1:
    form.h:4:27: QtCore/QVariant: 没有那个文件或目录
    form.h:5:25: QtGui/QAction: 没有那个文件或目录
    form.h:6:30: QtGui/QApplication: 没有那个文件或目录
    form.h:7:30: QtGui/QButtonGroup: 没有那个文件或目录
    form.h:8:27: QtGui/QComboBox: 没有那个文件或目录
    form.h:9:29: QtGui/QHBoxLayout: 没有那个文件或目录
    form.h:10:24: QtGui/QLabel: 没有那个文件或目录
    form.h:11:27: QtGui/QLineEdit: 没有那个文件或目录
    form.h:12:29: QtGui/QPushButton: 没有那个文件或目录
    form.h:13:25: QtGui/QWidget: 没有那个文件或目录
    form.h:14:29: QtGui/QMainWindow: 没有那个文件或目录
    form.h:15:28: QDoubleValidator: 没有那个文件或目录
    form.h:16:18: QDebug: 没有那个文件或目录
    In file included from main.cpp:1:
    form.h:19: error: expected class-name before '{' token
    form.h:21: error: ISO C++ forbids declaration of `Q_OBJECT' with no type
    form.h:21: error: expected `;' before "public"
    form.h:24: error: expected `:' before "slots"
    form.h:25: error: expected primary-expression before "void"
    form.h:25: error: ISO C++ forbids declaration of `slots' with no type
    form.h:25: error: expected `;' before "void"
    form.h:27: error: ISO C++ forbids declaration of `QWidget' with no type
    form.h:27: error: expected `;' before '*' token
    form.h:28: error: ISO C++ forbids declaration of `QHBoxLayout' with no type
    form.h:28: error: expected `;' before '*' token
    form.h:29: error: ISO C++ forbids declaration of `QLineEdit' with no type
    form.h:29: error: expected `;' before '*' token
    form.h:30: error: ISO C++ forbids declaration of `QComboBox' with no type
    form.h:30: error: expected `;' before '*' token
    form.h:31: error: ISO C++ forbids declaration of `QLineEdit' with no type
    form.h:31: error: expected `;' before '*' token
    form.h:32: error: ISO C++ forbids declaration of `QLabel' with no type
    form.h:32: error: expected `;' before '*' token
    form.h:33: error: ISO C++ forbids declaration of `QLineEdit' with no type
    form.h:33: error: expected `;' before '*' token
    form.h:34: error: ISO C++ forbids declaration of `QWidget' with no type
    form.h:34: error: expected `;' before '*' token
    form.h:35: error: ISO C++ forbids declaration of `QHBoxLayout' with no type
    form.h:35: error: expected `;' before '*' token
    form.h:36: error: ISO C++ forbids declaration of `QPushButton' with no type
    form.h:36: error: expected `;' before '*' token
    form.h:37: error: ISO C++ forbids declaration of `QPushButton' with no type
    form.h:37: error: expected `;' before '*' token
    form.h:38: error: ISO C++ forbids declaration of `QLabel' with no type
    form.h:38: error: expected `;' before '*' token
    form.h:39: error: ISO C++ forbids declaration of `QDoubleValidator' with no typeform.h:39: error: expected `;' before '*' token
    main.cpp:2:23: QtGui/QtGui: 没有那个文件或目录
    main.cpp: In function `int main(int, char**)':
    main.cpp:6: error: `QApplication' undeclared (first use this function)
    main.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
    main.cpp:6: error: expected `;' before "app"
    main.cpp:9: error: 'class Form' has no member named 'show'
    main.cpp:10: error: `app' undeclared (first use this function)
    main.cpp: At global scope:
    main.cpp:5: warning: unused parameter 'argc'
    main.cpp:5: warning: unused parameter 'argv'
    make: *** [main.o] 错误 1

  4. #4
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compile Errors

    You are using Qt 3.3.3 but the code is for Qt 4 and that is why you are getting the errors

Similar Threads

  1. Qt compilation errors
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2006, 17:29
  2. Qt Compile Errors?
    By magikalpnoi in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2006, 22:18
  3. Project won't compile under Windows (works under Linux)
    By philski in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2006, 15:29
  4. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  5. Problem to compile with MinGW + Qt 4 + winpcap
    By jlbrd in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2006, 16:32

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.