C++ Compiler Error in Cygwin: What Is It?

  • Context: C/C++ 
  • Thread starter Thread starter Logarythmic
  • Start date Start date
  • Tags Tags
    C++ Compiler Error
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
Logarythmic
Messages
277
Reaction score
0
I'm trying to learn C++ and am using Cygwin. When I try to compile my program I get the message

/cygdrive/c/DOCUME~1/Stoffe/LOKALA~1/Temp/ccQt0yU6.o:driver.cpp:(.text+0x9d6): undefined reference to `Person::~Person()´

What is this kind of error?
 
Physics news on Phys.org
It looks like you don't have a destructor for class Person. Or you are bringing in/linking in some code that is missing something. I can't tell.
 
The destructor is well defined. I really can't find anything wrong..
 
Post your code. You must be referencing the class "Person", before it has been declared. Or else it must be something very similar.

Sometimes, these errors can even be caused by a missed semicolon at the end of a class declaration.
 
I found it. I forgot to include the .cpp at the bottom. ;)