By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,852 Members | 2,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

Weird C++ error

P: n/a
Hi,
I keep getting this weird error when trying to compile a program:
CMainWindowDer.o(.text+0x3666): In function
`CMainWindowDer::OpenProjectOpties()':
/home/sakis/3e_trimester/trim-project/gui/CMainWindowDer.cpp:398: undefined
reference to `CProjectOpties::CProjectOpties[in-charge]()'
CMainWindowDer.o(.text+0x369c):/home/sakis/3e_trimester/trim-project/gui/CMainWindowDer.cpp:400:
undefined reference to `CProjectOpties::~CProjectOpties [in-charge]()'
main.o(.text+0x35): In function `main':
/home/sakis/3e_trimester/trim-project/gui/main.cpp:11: undefined reference
to `CProjectOpties::CProjectOpties[in-charge]()'
main.o(.text+0x51):/home/sakis/3e_trimester/trim-project/gui/main.cpp:17:
undefined reference to `CProjectOpties::~CProjectOpties [in-charge]()'
collect2: ld returned 1 exit status
make: *** [gui] Error 1
Can anyone help me out with this one?
I can't seem to find this error...
--Saki

--
Athanasios (Saki) Arkoudopoulos
http://lumumba.luc.ac.be/~saki/
Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Saki Arkoudopoulos wrote:
to `CProjectOpties::CProjectOpties[in-charge]()'
main.o(.text+0x51):/home/sakis/3e_trimester/trim-project/gui/main.cpp:17:
undefined reference to `CProjectOpties::~CProjectOpties [in-charge]()'
collect2: ld returned 1 exit status


Have you defined the destructor for class CProjectOpties ?

--
CrayzeeWulf
Jul 23 '05 #2

P: n/a
Saki Arkoudopoulos wrote:
I keep getting this weird error when trying to compile a program:
CMainWindowDer.o(.text+0x3666): In function
`CMainWindowDer::OpenProjectOpties()':
/home/sakis/3e_trimester/trim-project/gui/CMainWindowDer.cpp:398: undefined
reference to `CProjectOpties::CProjectOpties[in-charge]()'
CMainWindowDer.o(.text+0x369c):/home/sakis/3e_trimester/trim-project/gui/CMainWindowDer.cpp:400:
undefined reference to `CProjectOpties::~CProjectOpties [in-charge]()'
main.o(.text+0x35): In function `main':
/home/sakis/3e_trimester/trim-project/gui/main.cpp:11: undefined reference
to `CProjectOpties::CProjectOpties[in-charge]()'
main.o(.text+0x51):/home/sakis/3e_trimester/trim-project/gui/main.cpp:17:
undefined reference to `CProjectOpties::~CProjectOpties [in-charge]()'
collect2: ld returned 1 exit status
make: *** [gui] Error 1
Can anyone help me out with this one?
I can't seem to find this error...


This seems to be a linker error. It could be that you're compiling all
..cpp files when needed, but are forgetting to add one or two of them to
the linker command line.

V
Jul 23 '05 #3

P: n/a
Saki Arkoudopoulos wrote:

I keep getting this weird error when trying to compile a program:
CMainWindowDer.o(.text+0x3666): In function
`CMainWindowDer::OpenProjectOpties()':
undefined reference to `CProjectOpties::CProjectOpties[in-charge]()' undefined reference to `CProjectOpties::~CProjectOpties

[in-charge]()'

You've declared a constructor and destructor for CProjectOpties,
but haven't defined them anywhere.

Or perhaps you have defined them somewhere that CMainWindowDer cannot
see. For example, if CProjectOpties is a template and the definitions
aren't #included by CMainWindowDer. Another possibility is that
you aren't passing the object file for CProjectOpties to the linker.

Jul 23 '05 #4

P: n/a
CrayzeeWulf wrote:

[...]

Have you defined the destructor for class CProjectOpties ?


I'm only using a couple of stl strings in that class.
That's why I left the destructor empty. Is this wrong?
Thanks for your help,

Saki
--
Athanasios (Saki) Arkoudopoulos
http://lumumba.luc.ac.be/~saki/
Jul 23 '05 #5

P: n/a
Old Wolf wrote:

[...]
Another possibility is that
you aren't passing the object file for CProjectOpties to the linker.


I created a makefile using qmake. Shouldn't qmake take care of this?
--Saki

--
Athanasios (Saki) Arkoudopoulos
http://lumumba.luc.ac.be/~saki/
Jul 23 '05 #6

P: n/a
Saki Arkoudopoulos skrev:
Old Wolf wrote:

[...]

Another possibility is that
you aren't passing the object file for CProjectOpties to the linker.

I created a makefile using qmake. Shouldn't qmake take care of this?
--Saki


Isn't qmake QT-specific?

-- Pelle
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.