I am learning my first language C++ and doing so by using a guidebook. Recently i got stuck with a problem an error called "undefined reference to BigDog(int)". For information all code written here is copied examples taken from the book.
I am using Code::blocks on ubuntu 14.04
The code is in two files:
main.cpp
#include<iostream>
using namespace std;
void BigDog(int KibblesCount);
int main()
{
BigDog(3);
return 0;
}
mystuff.cpp
#include<iostream>
using namespace std;
void BigDog(int KibblesCount)
{
cout << "I'm a lucky dog" << endl;
cout << "I have" << KibblesCount << " pieces of food" << endl;
}
When i compile this in code::block i get the following error "undefined reference to 'BigDog(int)'"
Any help is appreciated.