Jump to content
  • Advertisement
Sign in to follow this  

Multiple .cpp files, one .h file?

This topic is 5065 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

All of my files call main.h, which holds my directdraw display device, surface, and palette files. The first file listed in my side panel is display.cpp. Problem is, my variables only get defined for that .cpp file, and I need them in other files. I'm declaring my LPDIRECTDRAWSURFACE7 variables as static variables, because otherwise my compiler gives me the already defined error. How do I avoid the "already defined" error, but make the variables accessible by every file in my project?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!