Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Linker errors when using class functions

Author
Message
Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 7th Oct 2010 19:51 Edited at: 7th Oct 2010 19:54
Hey, i had my class setup and working, but it wasnt reading from the file and was being defined at the start of the main function.
So i added in a function which reads from the file the users settings, if it does exist it gets created, kinda simple (it worked 100% when i used local variables).
So then i decide to link it up to the classes variables to obviously get it globally, and i get a huge load of errors for each time these variables are called.

Errors: (yeah i was gona try and do a netstorm remake)


Code for main.cpp: (17 lines)


Code for Core.h: (9 lines)


Code for Core.cpp: (119 lines)


I know im using the C and not the C++ library for reading files, but i find this way alot more logical. (also that isnt the error). The comments ive made are just notes for me so i remember what each part does when i look back at it in a few weeks.

I also realise i shouldnt use atoi without checking the string first, but this is really getting it working first.

Thanks in advance

Smoke me a kipper, ill be back for breakfast.
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 7th Oct 2010 21:59
You have to initialize static class member variables outside of the class.

Put the initialization for them somewhere. (Preferably in Core.cpp)


“C++ : Where friends have access to your private members.”
-Gavin Russell Baker
Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 8th Oct 2010 00:54
Ahh, thanks mate.

Smoke me a kipper, ill be back for breakfast.

Login to post a reply

Server time is: 2024-11-19 18:46:28
Your offset time is: 2024-11-19 18:46:28