Results 1 to 13 of 13

Thread: Undefined reference

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Undefined reference

    Quote Originally Posted by marcel View Post
    Isn't "#endif" already there?
    Heh, you're right. I managed to miss it, sorry.

    Edit: Salazaar, could you show us your .pro file?
    J-P Nurmi

  2. #2
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Undefined reference

    Sure.
    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) N 13. maj 20:51:00 2007
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET =
    7. DEPENDPATH += .
    8. INCLUDEPATH += .
    9.  
    10. # Input
    11. RESOURCES = images.qrc
    12. HEADERS += maker.h ui_maker.h ui_about.h
    13. SOURCES += main.cpp maker.cpp
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Undefined reference

    Quote Originally Posted by Salazaar View Post
    HEADERS += maker.h ui_maker.h ui_about.h
    It should be:
    Qt Code:
    1. HEADERS += maker.h
    2. FORMS += maker.ui about.ui
    To copy to clipboard, switch view to plain text mode 
    This way qmake will generate ui_*.h file automatically every time you change the .ui file.

  4. #4
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Undefined reference

    This was created by qmake. And I was trying to compile other applications this qmake system and it was ok

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

    Default Re: Undefined reference

    You should create project files with qmake before you start compilation, not after that. Then only update the file manually.

  6. #6
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Undefined reference

    Sure I create project file before compiling, that's the procedure.

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

    Default Re: Undefined reference

    If you did, you wouldn't end up with ui_*.h files in it as these are created by uic during compilation. Unless of course you added them manually.

  8. #8
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Undefined reference

    I've solved the problem (I don't know exactly how) but I still don't understand what was the problem about. I've got all my files and run qmake-project

Similar Threads

  1. Compiling error
    By Foobar in forum Newbie
    Replies: 2
    Last Post: 18th March 2007, 00:02
  2. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 20:15
  3. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 20:36
  4. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 02:01
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 9th March 2006, 00:11

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
  •  
Qt is a trademark of The Qt Company.