I've been having no end of trouble just getting started with C++. Seems like no matter what I do, I've got dozens of errors. I've taken to compiling example code from tutorials, but even the example code doesn't compile. For example, the code at: http://www.cppgameprogramming.com/cgi/nav.cgi?page=arrayclasses
gives me lots of flack when I try to:
$ g++ main.cpp -o dog
It says:
> main.cpp: In function 'int main()': main.cpp:18:15: warning: deleting
> array 'Dog myDogs [5]'
> C:\Users\bob-pc\Appdata\Local\Temp\ccTXXCOB.o:main.cpp:(.text+0x21):
> undefined rference to 'Dog::Dog()' C:\Users\bob-pc\Appdata\Local\Temp\ccTXXCOB.o:main.cpp:(.text+0x59):
> undefined rference to 'Dog::setAge(int)' C:\Users\bob-pc\Appdata\Local\Temp\ccTXXCOB.o:main.cpp:(.text+0x88):
> undefined rference to 'Dog::getAge()' collect2: Id returned 1 exit status
This isn't the first time I've tried straight copying example code & compiling it. I'm having lots of trouble even after I go over syntax, but I just can't seem to get headers & libraries working right. Any help much appreciated.