Chaos Project

Game Development => Sea of Code => Topic started by: Zexion on April 02, 2013, 05:49:43 pm

Title: Undeclared(first use in function) C++
Post by: Zexion on April 02, 2013, 05:49:43 pm
Okay, so today in class we were doing some in-class activity along with the teacher. She told us exactly what to type and blah blah. I did what she said and I got this error that a variable was undeclared. The variable is defined in the header file that we made. Do I have to declare it again in the main()? I don't know if she did, so I might be doin it rong guys
Title: Re: Undeclared(first use in function) C++
Post by: Ryex on April 02, 2013, 10:43:05 pm
are you sure the Header file was included in the cpp file?
Code: cpp
#include 'myheader.h'

was at the top of the file
Title: Re: Undeclared(first use in function) C++
Post by: Zexion on April 03, 2013, 03:06:49 pm
Yeah, since it was due yesterday, I just made a cheap fix by re-declaring them in the main file, but I did have the header file defined at the top. I'd like to fix this though because I'm sure it will keep happenning in the future D: