Why does codeblocks give this error \"Undefined reference to class::classfunction()\"
It happens when a class is created in a separated file.All of these files are in the same f
You need to link both main.o and class.o into your executable. The exact command depends on your compiler and OS. For g++ the command would look something like