Qt gives "undefined reference" error when compiling

M

mihailsmilev

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.
 
M

mlimber

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
 
V

Victor Bazarov

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
 
J

Jim Langston

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?
 
M

mihailsmilev

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.
 
M

mlimber

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.
 
R

Robert

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top