3
I would like to compile the implementation of a class in order to only generate an object code from it. This is the implementation of the class:
#include <iostream>
#include "gradebook.h"
using namespace std;
GradeBook::GradeBook(string name_course_param)
{
setCourseName(name_course_param);
}
void GradeBook::setCourseName(string name_course_param)
{
courseName = name_course_param;
}
string GradeBook::getCourseName()
{
return courseName;
}
void GradeBook::displayMessage()
{
cout << "Welcome to the grade book for\n" << getCourseName()
<< "!" << endl;
}
I know I need the interface, as you can already see I’m already using through the inclusion of the header file gradebook.h.
What I need to know is how to generate the object code of this class, GradeBook, to make available for the user’s use of it through the gradebook.h. How to do it by g++?
Don’t you know how to make the compiler generate the object? Or is it another question?
– Maniero
How to make the compiler generate the @bigown object
– user53564
If I didn’t ask the question correctly, please edit it, I’m a beginner and maybe I didn’t understand correctly the operation of the interface and implementation of a @bigown class
– user53564
I just wanted to be sure, you were prudent in putting as much information as possible, even more than I needed (but didn’t know yet), so I wanted to be sure what I was asking.
– Maniero