Projects

nbk

Newbie
Joined
Aug 20, 2004
Messages
135
Reaction score
1
When you create a project(with two or more .cpp files), where do the files 'type in' the code. I am having the definitions of my class in xxxx.h, and the definitions of the member functions in xxxx.cpp, and the main program in main.cpp, and I get linker errors. I'll post code if ya need it.
 
What kind of link errors do you get? please be a little more specific.
 
maybe you're just forgetting the multiple inclusion prevention
#ifndef BLA_BLA
#define BLA_BLA
 
The undefined reference ones.

Sim.h = class definition
Sim.cpp = Member function definitions
Main.cpp = I create an instance of Sim, mySim. I then go to a switch statement, to find what member function to use. All of the functions in the switch statement have the undefined reference to Sim::function().
 
Ahh, I fixed it. It was a fault of my own stupidity :\
 
Back
Top