Results 1 to 3 of 3

Thread: undefined reference to QObject

  1. #1

    Default undefined reference to QObject

    Hi

    I've coded an application under windows and am now having a hard getting it to run under linux. Under windows it runs and compiles fine.

    management.o: In function `Management::Management(QCoreApplication*)':
    management.cpp.text+0x7d): undefined reference to `QObject::QObject(QObject const&)'
    management.o: In function `Management::Management(QCoreApplication*)':
    management.cpp.text+0x2e3): undefined reference to `QObject::QObject(QObject const&)'

    is the error I'm getting from the linker. The management is the class I'm calling from main().

    Any ideas?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: undefined reference to QObject

    Is this error or warning...
    can u show the code which is giving error ?

  3. #3

    Default Re: undefined reference to QObject

    Doesn't say; next line is "collect2: ld returned 1 exit status" though, so I'm guessing it's an error.

    I don't actually know what part of the code is causing the error. Those hex numbers don't translate to line numbers in the source file. I don't have any calls to Object-anything; only thing are some connect()s.

    management.cpp is part of a larger project. There are a lot of Qt related includes and up to the linking I'm not getting any errors.

Similar Threads

  1. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  2. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 13:41
  3. error undefined reference ...............
    By amit_pansuria in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2007, 14:28
  4. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  5. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 19:36

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.