Weird C++ error

S

Saki Arkoudopoulos

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
 
C

CrayzeeWulf

Saki said:
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 ?
 
V

Victor Bazarov

Saki said:
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
 
O

Old Wolf

Saki said:
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.
 
S

Saki Arkoudopoulos

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
 
S

Saki Arkoudopoulos

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
 
P

Pelle Beckman

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
 

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,770
Messages
2,569,586
Members
45,088
Latest member
JeremyMedl

Latest Threads

Top