When you run a program, the program starts with the main() function by definition. You need a main() somewhere in your project, and whatever file contains main() should be the one you compile to create your executable. You can just put main in another file (e.g. main.cpp) and that way keep your implementation stuff separate.
Oh, and when I start my computer, I use the power button, not a .o file :lol:
Infarction
Posting Virtuoso
1,580 posts since May 2006
Reputation Points: 683
Solved Threads: 53
The #include "myheader.h" will essentially paste the contents of myheader.h into the top of whatever file it is #included into. So it'll be comiled just fine. In order to get the .cpp file compiled, you can just specify it first on the command line, e.g.
$ g++ myheader.cpp main.cpp
and the linker should take care of everything... I think... (been a li'l while...)
Infarction
Posting Virtuoso
1,580 posts since May 2006
Reputation Points: 683
Solved Threads: 53
Haha, anyone who can recognize BPS deserves a hand... and your ava isn't bad either ;)
Infarction
Posting Virtuoso
1,580 posts since May 2006
Reputation Points: 683
Solved Threads: 53