Results 1 to 4 of 4

Thread: [SOLVED] Qt example not working " expected class-name before '{' token"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [SOLVED] Qt example not working " expected class-name before '{' token"

    Hi, I've just started to read about Qt, so I bought a book and downloaded a library to be used with the examples. When I try to compile that library I get the error of the class name. I've had a look at the code but didn't see anything wrong.

    The error:


    make[1]: se ingresa al directorio `/mnt/almacen/dev-libs/utils'
    g++ -c -pipe -march=athlon64 -O2 -pipe -march=athlon64 -O2 -Wall -W -D_REENTRANT -fPIC -DLIBRARY_BUILD -D__PWD__=/home/whisp/almacen/dev-libs/utils -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
    -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.moc -I.ui -o .obj/exception.o exception.cpp
    In file included from exception.cpp:1:
    exception.h:8: error: expected class-name before '{' token
    make[1]: *** [.obj/exception.o] Error 1



    and the code from exception.h until the line of the error (not my code, as I've said before)
    Qt Code:
    1. #ifndef EXCEPTION_H
    2. #define EXCEPTION_H
    3.  
    4. #include <qtconcurrentexception.h>
    5. #include <QString>
    6.  
    7.  
    8. class Exception : public QtConcurrent::Exception {
    9.  
    10. // member declarations
    11. }
    To copy to clipboard, switch view to plain text mode 

    I know this kind of error would have been caused by a typo in the classname, or if the class hadn't been declared, but it's declared in qtconcurrentexception.h , and in the QtConcurrentNamespace, so... what's wrong??
    Last edited by davidmmx; 26th April 2009 at 17:54.

Similar Threads

  1. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 07:57
  2. Need help integrating sigc++ with a KDE3/Qt3 app
    By Valheru in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 15:39
  3. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09
  4. Replies: 2
    Last Post: 4th May 2006, 19:17

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.