I am trying to implement an "audio" object that will hold a patient's first name, last name and dob.
I'm am trying to initialize an instance of the object, which I happen to name 'the patient' in the main file, included below, but I get a compile error. This is the error: /tmp/ccHKkLmo.o: In function `main':
theaudio.cpp:(.text+0x131): undefined reference to `Audio::Audio(std::string, std::string, std::string)'
collect2: error: ld returned 1 exit status
How are you compiling? Via the command line? You must link the different files into the same executable. I suggest you use an IDE where you add this code into a project; the IDE will link it for you.
You've also got a problem in your constructor at lines 85-87. Your assignments are reversed. cpatient_xx is the argument being passed in. patient_xxx is the member of the class. It should be:
As a side note I suggest you use Code::Blocks, it is light, cross-platform and easy to use but can be elaborate as well. Comes with debugging tools built in.
I know hindsight is a wonderful thing, but I mention these things to make it easier for respondents, and to provide some info for others.
Given all the errors identified so far, It seems to me that that the OP should have posted all the compile errors, not just one, and specified more detail about the compiler & system being used.
People who reply either have to have an eagle-eye when doing in-brain compiling, or they compile it themselves. Much easier to look at the compile errors posted by the OP.
One should set the compiler warnings to their maximum, on g++ :
-Wall -Wextra -pedantic
And to be really thorough, promote all warnings to errors with -Werror