Jump to content

  • Log In with Google      Sign In   
  • Create Account

File Including error


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 19 May 2013 - 08:52 PM

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, 19 May 2013 - 08:59 PM.


Sponsor:

#2 frob   Moderators   -  Reputation: 21479

Like
0Likes
Like

Posted 19 May 2013 - 09:36 PM

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.
Check out my personal indie blog at bryanwagstaff.com.

#3 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 20 May 2013 - 01:06 AM

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


#4 ApochPiQ   Moderators   -  Reputation: 15832

Like
0Likes
Like

Posted 20 May 2013 - 01:15 AM

Sounds like you may have a circular dependency issue. Can you post the declarations for each class?

#5 Crusable   Members   -  Reputation: 594

Like
0Likes
Like

Posted 20 May 2013 - 02:35 PM

I figured out how to fix it.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS