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

AI Thread Summary
The discussion revolves around a compilation error encountered while learning C++ using Cygwin. The error message indicates an "undefined reference" to the destructor of the class "Person." This typically suggests that either the destructor is not defined or there is an issue with linking the code. Participants note that the error could stem from referencing the class before its declaration or from a missing semicolon at the end of the class declaration. Ultimately, the user identifies the issue as forgetting to include the .cpp file in the compilation command.
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?
 
Technology 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. ;)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top