Qt gives "undefined reference" error when compiling

Discussion in 'C++' started by mihailsmilev@gmail.com, Mar 7, 2006.

  1. Guest

    Hello,
    let me first describe the situation: I am developing an application
    using Qt Designer 3.3.5 on OpenSuSE Linux for my mp3 player. So I need
    to get the id3 tags from the mp3 files, and I've downloaded the sources
    of id3lib. I've included the headers (there are no other files) in my
    project in Qt designer, then created an object from my files. When
    starting the make command, it compiles normally all the headers
    (although giving some minor warnings) but at the end it gives me an
    "undefined reference" error to the constructor and destructor of the
    object which I create in my source file. Please help! I've tryed
    everything. Before I start make, I always start qmake, also I've
    checked my .pro file for the HEADERS directive, and everything is OK -
    all headers are listed normally.
     
    , Mar 7, 2006
    #1
    1. Advertising

  2. mlimber Guest

    wrote:
    > Hello,
    > let me first describe the situation: I am developing an application
    > using Qt Designer 3.3.5 on OpenSuSE Linux for my mp3 player. So I need
    > to get the id3 tags from the mp3 files, and I've downloaded the sources
    > of id3lib. I've included the headers (there are no other files) in my
    > project in Qt designer, then created an object from my files. When
    > starting the make command, it compiles normally all the headers
    > (although giving some minor warnings) but at the end it gives me an
    > "undefined reference" error to the constructor and destructor of the
    > object which I create in my source file. Please help! I've tryed
    > everything. Before I start make, I always start qmake, also I've
    > checked my .pro file for the HEADERS directive, and everything is OK -
    > all headers are listed normally.


    First of all, are you really compiling headers? I'm not a Qt user, but
    that is not standard practice in C++.

    Can you reduce the problem so that you can show us some actual code
    (cf. http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9)?
    If not, you will probably have more success seeking help from Trolltech
    directly (do they have user forums or tech support?) or some other
    newsgroup related to Qt. See the FAQ for some ideas of where you could
    post:

    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9

    Cheers! --M
     
    mlimber, Mar 7, 2006
    #2
    1. Advertising

  3. wrote:
    > let me first describe the situation: I am developing an application
    > using Qt Designer 3.3.5 on [..irrelevant..] When
    > starting the make command, it compiles normally all the headers


    It compiles the _headers_? Really?

    > (although giving some minor warnings) but at the end it gives me an
    > "undefined reference" error to the constructor and destructor of the
    > object which I create in my source file.


    Did you _define_ the constructor and destructor it complains about?

    > Please help! I've tryed
    > everything. Before I start make, I always start qmake, also I've
    > checked my .pro file for the HEADERS directive, and everything is OK -
    > all headers are listed normally.


    Have you tried actually linking your project together? You know, by
    giving the linker all the _object_ files in the *same command*? Do you
    know what that means? Perhaps you should post to a newsgroup for your
    compiler...

    V
    --
    Please remove capital As from my address when replying by mail
     
    Victor Bazarov, Mar 7, 2006
    #3
  4. Jim Langston Guest

    <> wrote in message
    news:...
    > Hello,
    > let me first describe the situation: I am developing an application
    > using Qt Designer 3.3.5 on OpenSuSE Linux for my mp3 player. So I need
    > to get the id3 tags from the mp3 files, and I've downloaded the sources
    > of id3lib. I've included the headers (there are no other files) in my
    > project in Qt designer, then created an object from my files. When
    > starting the make command, it compiles normally all the headers
    > (although giving some minor warnings) but at the end it gives me an
    > "undefined reference" error to the constructor and destructor of the
    > object which I create in my source file. Please help! I've tryed
    > everything. Before I start make, I always start qmake, also I've
    > checked my .pro file for the HEADERS directive, and everything is OK -
    > all headers are listed normally.


    Why don't you just include the header with one of the source files?
     
    Jim Langston, Mar 8, 2006
    #4
  5. Guest

    Well actually that's what I am doing: I include the headers in my
    sources file. So about the definition, I'm using already written
    sources, and as far as I can see, the constructor and destructor are
    defined there. About the linker: I'm using the "make" command which
    should do all the work for me. This make file is generated by qmake,
    which is command of Trolltech Qt.
     
    , Mar 8, 2006
    #5
  6. mlimber Guest

    wrote:
    > Well actually that's what I am doing: I include the headers in my
    > sources file. So about the definition, I'm using already written
    > sources, and as far as I can see, the constructor and destructor are
    > defined there. About the linker: I'm using the "make" command which
    > should do all the work for me. This make file is generated by qmake,
    > which is command of Trolltech Qt.


    I will reiterate then: post a minimal but compilable sample that
    demonstrates the problem. If you can't do that, I will again suggest
    you look for Trolltech-centric help. This forum is for discussions of
    *standard* C++ language and libraries, not third-party products or
    applications (see
    http://parashift.com/c -faq-lite/how-to-post.html#faq-5.9).

    Cheers! --M

    PS, Please quote the message you are responding to since not everyone
    is using Google Groups and the like. You can do this automatically in
    Google Groups by clicking on "show options" and then "reply" in the
    revealed header.
     
    mlimber, Mar 8, 2006
    #6
  7. Robert Guest

    wrote:
    > Hello,
    > let me first describe the situation: I am developing an application
    > using Qt Designer 3.3.5 on OpenSuSE Linux for my mp3 player. So I need
    > to get the id3 tags from the mp3 files, and I've downloaded the sources
    > of id3lib. I've included the headers (there are no other files) in my
    > project in Qt designer, then created an object from my files. When
    > starting the make command, it compiles normally all the headers
    > (although giving some minor warnings) but at the end it gives me an
    > "undefined reference" error to the constructor and destructor of the
    > object which I create in my source file. Please help! I've tryed
    > everything. Before I start make, I always start qmake, also I've
    > checked my .pro file for the HEADERS directive, and everything is OK -
    > all headers are listed normally.
    >

    Hi, I use Qt, but can't help you with what you gave here. Generally..
    you qmake -project && qmake && make if files are in the same directory.

    Actually, I don't think you're going about this the right way. Unless
    there is a _real_ good reason, you don't want to include the mp3
    headers in the Qt designer. You should do the Qt designer stuff and
    then make your own subclass off the form. You would then include the
    mp3 stuff in your subclass code and using the inherited (Qt) elements.
    Also, be sure you have the .so to go along with the headers.

    Anyway, did you know about
    http://www.qtcentre.org/ -and-
    http://lists.trolltech.com/ The Qt-interest list would be the one.

    --
    Robert
     
    Robert, Mar 8, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shuaib
    Replies:
    1
    Views:
    1,042
    Shuaib
    Aug 19, 2006
  2. rhzehr
    Replies:
    4
    Views:
    1,150
    Mark McIntyre
    Apr 25, 2005
  3. Replies:
    8
    Views:
    469
    Barry Schwarz
    Jun 2, 2006
  4. Replies:
    17
    Views:
    420
    SuperKoko
    Jun 14, 2006
  5. PS
    Replies:
    0
    Views:
    889
Loading...

Share This Page