Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Psybr

class instances across files

This topic is 5965 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

ive seperated my rendering functions into two files, initialization and shutdown, and the main loop. i put the class instances (e.g. CLight CharLight) into a header file, then used defines to try to make the compiler not give me any errors, but the linker complains that the class instances are already defined. is there a way to get around this, or do i have to merge my functions back into one file?

Share this post


Link to post
Share on other sites
Advertisement
Define them as extern (e.g. extern CLight CharLight) in the header file, and then in one of the source files, define them as normal (e.g. CLight CharLight).

Share this post


Link to post
Share on other sites

  • 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!