EDIT: Thank you to everyone who answered, I'm sure whatever it is it was anomalistic and it won't kill my program. Even if you're killing it on the forums reputation wise, that doesn't give you the right to condescend people who are just trying to enter the community, so please remember to be duly respectful if you're going to take the time to help. Otherwise who what's the use?
Once, again thank you to everyone who contributed thoughtfully
EDIT: The original code had an inline declaration, which seemed like it was the issue but the linker error still persists after removing it.
As the title suggests, I'm having an issue with a specific function. I keep getting a linking error when calling it from main, despite the rest of the functions defined in the class .cpp working fine. I moved the function to the header file to check if it was just an issue with the function itself but it was not, since it compiled fine then. I'm new to c++ but feel like I understand separating source code between files pretty well. However, I'm completely lost with this one.
Here it is forward declared in the header:
Screen &move(pos r, pos c);
Here it is defined in the associated .cpp:
Screen& Screen::move(pos r, pos c) {
pos row = r * width;
cursor = row + c;
return *this;
}
Both the main source and the associated source files #include the header file, and as I said, the other functions seem to be working fine.
Thank you!