Globals [RESOLVED]

Started by
10 comments, last by JohnBolton 17 years, 11 months ago
Quote:Original post by chollida1
Only declare the variable in the header and in any other cpp that needs it use extern

That is backwards. The AP posted the correct solution. You have the variable screen defined in two places. Just define it in one or the other. The "extern" declaration in the Globals.h will take care of declaring it wherever else it may be used.

BTW, globals are evil, but globals.h and globals.cpp are even more evil.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Advertisement
Read this if you haven't already: Organizing Code Files in C and C++
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement