Jump to content
  • Advertisement
Sign in to follow this  
Crusable77

File Including error

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

Hello

 

I have two classes one named ImageSystem which holds sf::Images in a std::map and passes them around my program so I only ever need to load the images once(singleton class). It also holds a std::map of my class Tileset. The Tileset class needs to use the ImageSystem class so it can get a sf::image to work with (incudes tileset). My program will not work and I believe this is the problem. I have my inclusion guards up so I didn't think this would be a problem.

 

Edit: I played around with it a little more and this is what is the problem with the program, how do I fix this?

Edited by Crusable

Share this post


Link to post
Share on other sites
Advertisement
What are your EXACT error messages?

Usually a header file missing or bad header guards will complain about "implicit declaration", or "does not support implicit" or "could not find declaration" varieties.

Share this post


Link to post
Share on other sites
Error 2 error C2143: syntax error : missing ';' before '&' c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 20 1 Game
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 20 1 Game
Error 5 error C2065: 'Tileset' : undeclared identifier c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 31 1 Game
Error 6 error C2923: 'std::map' : 'Tileset' is not a valid template type argument for parameter '_Ty' c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 31 1 Game
Error 7 error C2065: 'Tileset' : undeclared identifier c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 32 1 Game
Error 8 error C2923: 'std::map' : 'Tileset' is not a valid template type argument for parameter '_Ty' c:\users\mathew bergen\documents\programming\c++\game\game\imagesystem.h 32 1 Game

Share this post


Link to post
Share on other sites
Sounds like you may have a circular dependency issue. Can you post the declarations for each class?

Share this post


Link to post
Share on other sites
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!