Results 1 to 7 of 7

Thread: not compiling

  1. #1
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default not compiling

    hi friends , the project given in below link is not compiling

    http://sector.ynet.sk/qt4-tutorial/m...plication.html

    i don't know y it is not compiling...... (may be due to Qt version)
    i am using Qt 4.3.2( linux X11)

    it giving the error as " Ui" is not declared
    pls clarify me , how compile that

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: not compiling

    What exact steps did you perform to create and build the project? Did you use qmake? Did you create a form in Designer? Did you inform qmake about the form? Did you include the proper file generated by uic?

  3. #3
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: not compiling

    i will explain procedure:-
    1)selected c++ project file and named it "filebrowser6"
    2)FILE->NEW-> Widget
    and named the form as filebrowser6
    3)FILE->NEW->c++ header file and paste the code as usual written in link(adding file to da project) named it "files.h"
    4)FILE->NEW->c++ source file(for constructor definition) and paste the code as usual written in link, named it "files.cpp"
    5)FILE->NEW->c++ source file(for main.cpp) and paste the code as usual written in link
    6)Included the header file in "include Declaration"
    7)Included the some QT header files in "include Implementation"
    8)saved all
    9)In terminal, typed as "qmake filebrowser6.pro"
    10)and "make"

    your que's

    yes I included the "filebrowser6.ui.h" in "files.h" header file which is generated by .ui
    yes I created the form in Designer
    yes i use qmake

    after comipling errors


    [sudheer@localhost filebrowser6]$ qmake filebrowser6.pro
    [sudheer@localhost filebrowser6]$ make
    Makefile:157: warning: overriding commands for target `moc_files.cpp'
    Makefile:154: warning: ignoring old commands for target `moc_files.cpp'
    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/usr/lib/qt-3.3/include -o main.o main.cpp
    In file included from main.cpp:2:
    files.h:6: error: `Ui' has not been declared
    files.h:7: error: expected class-name before '{' token
    make: *** [main.o] Error 1

    i also attached project in zip format

    so plz clarify me thanks

    regards
    Attached Files Attached Files

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: not compiling

    You are mixing Qt3 and Qt4 here. You use qmake from Qt3, you have written Qt3 code yourself, but the "files" class is created like it was a Qt4 class. Either switch KDevelop to use Qt3 instead of Qt4 or switch yourself to Qt4.

  5. #5
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: not compiling

    so wat should i do, i have downloaded "qt-x11-opensource-src-4.3.2" version,
    and i working on Red hat Enterprise Linux4 version,

    as i am new to the QT i don't have much knowledge about this, so plz explain me in detail
    how i integrate designer form file with my source files and how to make the project and make

    But i can able to design simple GUI applications and making it without any errors, like just creating slots and defining its functions in ".ui.h" file and connecting these slots to 'pushbuttons, lineedit, so on...'

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: not compiling

    Quote Originally Posted by sudheer View Post
    so wat should i do, i have downloaded "qt-x11-opensource-src-4.3.2" version,
    and i working on Red hat Enterprise Linux4 version,

    as i am new to the QT i don't have much knowledge about this, so plz explain me in detail
    how i integrate designer form file with my source files and how to make the project and make
    Go to our wiki and read the articles you might find useful. Also take a look at the tutorial present in Qt reference manual.

    But i can able to design simple GUI applications and making it without any errors, like just creating slots and defining its functions in ".ui.h" file and connecting these slots to 'pushbuttons, lineedit, so on...'
    ".ui.h" file are a Qt3 concept that is not present in Qt4 anymore.

  7. #7
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: not compiling

    than q u very much , the tutorial in wiki is really worthy
    now i can able to compile that(myapplication, in the link) project quite easily

    actually wat happends is during the Qt4.3.2 installation, i left the computer over night so qmake is configured to qt3.3 that's da mistake i had done

Similar Threads

  1. Compiling error
    By Ucef in forum Newbie
    Replies: 1
    Last Post: 18th March 2007, 01:15
  2. Compiling custom Qt3 Widgets Gives warning in VC++6 Compiler
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2006, 12:44
  3. Replies: 10
    Last Post: 28th April 2006, 15:48
  4. qmake_image_collection.cpp gives me a compiling error
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 31st January 2006, 01:42
  5. compiling a qt project under win32
    By elcuco in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2006, 07:43

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.