You're going to get these undefined references errors all the time UNTIL you put ALL the .o files on your list. If you are referencing something that appears in a different file, well then, it's not going to work if you decide to leave that file out. Here it's referencing a member variable of the class, so the compiler needs to make sure it has the definition of the class.