It looks basic and it’s probably due to a beginner mistake but I can’t figure out why...
When compiling I get an error like below from int main(): “undefined reference to 'Hello::World::PaintService::PaintService()"
paint.cpp
using namespace Hello;
int main(int argc, char **argv) {
World::PaintService service;
service.start_painting(argc[1]);
}
PaintService and start_painting are defined like below:
paint_service.h
namespace Hello {
namespace World {
class PaintService {
public:
PaintService();
void start_painting(...);
}; } }
paint_service.cpp
namespace Hello {
namespace World {
void start_painting(....) {
... //paint
}
} }
It seems simple to call that start method like service.start_paint() in another class after calling PaintService service, but something is wrong. I have tried lots of variations yet couldn’t figure out :-/ Could someone point out what I’m doing wrong?
Thanks!