File Including error

Started by
3 comments, last by Crusable77 10 years, 11 months ago

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?

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.
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
Sounds like you may have a circular dependency issue. Can you post the declarations for each class?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

I figured out how to fix it.

This topic is closed to new replies.

Advertisement