Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Qt gives "undefined reference" error when compiling

Reply
Thread Tools

Qt gives "undefined reference" error when compiling

 
 
mihailsmilev@gmail.com
Guest
Posts: n/a
 
      03-07-2006
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.

 
Reply With Quote
 
 
 
 
mlimber
Guest
Posts: n/a
 
      03-07-2006
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-lit...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-lit...t.html#faq-5.9

Cheers! --M

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      03-07-2006
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
 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      03-08-2006
<> wrote in message
news: ups.com...
> 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?


 
Reply With Quote
 
mihailsmilev@gmail.com
Guest
Posts: n/a
 
      03-08-2006
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.

 
Reply With Quote
 
mlimber
Guest
Posts: n/a
 
      03-08-2006
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/ho....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.

 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      03-08-2006
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 09:47 PM
Cross-compiling error when compiling 2.6.1... Garrett Cooper Python 0 02-24-2009 08:55 PM
Error using SOPC builder - "Custom SDRAM" with 8-bits gives error with Signal "az_be_n" sendthis@gmail.com VHDL 1 10-19-2007 06:56 PM
Compiling with -O option gives different running time! aamircheema@gmail.com C Programming 17 06-14-2006 08:46 AM
Compiling when libedit is in path Is there a trick to compiling Ruby when libedit must exist in the search path? Can you statically link to readline 5.0 in some manner? -- Lon Baker Lon Baker Ruby 1 03-21-2005 08:57 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57