Unresolved Externals - not missing .lib files tho
I have a structure which stores all the game states like high score, level etc. This is in it's own header file called GameStates.h.
I've got a global object of this throughout the entire project - GStatesMain - to make accessing the structure members easier without the need to constantly declare local objects.
I've got a function that will read the contents of a file into an array for the high-scores which is accesed through this variable - it's this which is causing the error:
fin >> GStatesMain.HighScores[h];
where h is an loop variable to loop through the file
If i comment out this line it compiles wihtout any errors or warnings but if i leave it in it gives an unresolved external which has really left me stumped.
Hope someone can help.
EDIT: fixed it, i had mispelt the variable name in main.cpp - works fine now
[edited by - Spudder on February 2, 2003 3:09:09 PM]
February 02, 2003 01:46 PM
Are you including the code to go with the header in your project aswell?
All of my header files are included in StdAfx.h like it said to, this is #included in all my .cpp files so that''s where i put my globals with extern and then again without extern in main.cpp which is the main file - this is how an article here on GD.net said to but anytime i try to access the GStates structure through GStatesMain i get an unresolved extrenal.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement