Hello Everybody . I'm new to the C++ community and environment too.
Anyway , I was trying to code a tiny portion of a RPG game in console and the problem comes with my Character Class.
The compiler refuse to compile because of that error: undefined reference to 'Character::Character()'
I fixed it a little bit, but there's still something with it.
I have replaced #ifdef DEF_CHARACTER by#ifndef DEF_Character Then..
I wrapped the header with the include guard like you said and I came up with something like this
What IDE do you use? It looks like that Character.cpp is ignored by the compiler otherwise it should have complained about the missing int m_vie. So it cannot be properly added to your project.
The include guard wasn't the source of your problem, just a side note
I use Codeblock, and the problem was into the property of Character.h
I check link file and compile and then it works , I didn't check there before
I got another warning from the compiler about all my attribute in private
The compiler said that there are all non static data member. What is the purpose of that?
By the way int m_vie was added to the showlife method, thank you