Click here to Skip to main content
15,914,401 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFile drag/drop problem, waiting for your help! Pin
andyxia4-May-04 1:21
andyxia4-May-04 1:21 
GeneralHook in dll Pin
yingkou4-May-04 0:31
yingkou4-May-04 0:31 
GeneralRe: Hook in dll Pin
Monty24-May-04 1:44
Monty24-May-04 1:44 
GeneralObj to Source file Pin
Gurou4-May-04 0:29
Gurou4-May-04 0:29 
GeneralRe: Obj to Source file Pin
toxcct4-May-04 0:46
toxcct4-May-04 0:46 
GeneralRe: Obj to Source file Pin
Gurou4-May-04 1:24
Gurou4-May-04 1:24 
GeneralRe: Obj to Source file Pin
toxcct4-May-04 1:27
toxcct4-May-04 1:27 
GeneralSyntax error: identifier 'x' when 2 headers include each other Pin
Ylis4-May-04 0:27
Ylis4-May-04 0:27 
I have 2 classes, and both classes needs to know of each other. Here's the headers:

sprite.h
<br />
#ifndef SPRITE_H<br />
#define SPRITE_H<br />
#include "SDL.h"<br />
#include "SDLgraphics.h"<br />
<br />
class sprite<br />
{<br />
public:<br />
	sprite( char * p_path, int p_noFrames );<br />
	void Animate( SDLgraphics &p_g );<br />
	SDL_Surface* GetSurface() { return m_image; }<br />
	SDL_Rect* GetRect() { return &m_image->clip_rect; }<br />
protected:<br />
	float m_x, m_y;<br />
	int m_noFrames;<br />
	int m_curFrame;<br />
	SDL_Surface* m_image;<br />
<br />
};<br />
#endif<br />


SDLgraphics.h
<br />
#ifndef SDLgraphics_H<br />
#define SDLgraphics_H<br />
#include <cstdio><br />
#include <cstdlib><br />
#include "SDL.h"<br />
#include "sprite.h"<br />
<br />
class SDLgraphics<br />
{<br />
public:<br />
	SDLgraphics(unsigned int p_flags);<br />
	void Init(int p_width, int p_height);<br />
	void Draw(sprite *p_sprite, SDL_Rect *p_area);<br />
	inline void Draw(sprite *p_sprite);<br />
	void Flip();<br />
protected:<br />
	SDL_Surface *m_scene;<br />
<br />
};<br />
#endif<br />


When I try to compile it in Visual Studio 7.0 .NET I get error C2061: syntax error : identifier 'SDLgraphics', and another one relating to sprite.

Greatful for any help Big Grin | :-D ;P
GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
toxcct4-May-04 0:39
toxcct4-May-04 0:39 
GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
Ylis4-May-04 0:54
Ylis4-May-04 0:54 
GeneralRe: Syntax error: identifier 'x' when 2 headers include each other Pin
Jens Doose4-May-04 0:39
Jens Doose4-May-04 0:39 
QuestionHooking a COM port ? Pin
Brian van der Beek4-May-04 0:12
Brian van der Beek4-May-04 0:12 
GeneralSDK problem Pin
Prakash Nadar3-May-04 23:57
Prakash Nadar3-May-04 23:57 
GeneralRe: SDK problem Pin
Jens Doose4-May-04 0:19
Jens Doose4-May-04 0:19 
GeneralRe: SDK problem Pin
2249174-May-04 0:39
2249174-May-04 0:39 
GeneralRe: SDK problem Pin
Prakash Nadar4-May-04 5:19
Prakash Nadar4-May-04 5:19 
GeneralRe: SDK problem Pin
Blake Miller6-May-04 8:25
Blake Miller6-May-04 8:25 
GeneralA question about OOP Pin
nguyenvhn3-May-04 23:55
nguyenvhn3-May-04 23:55 
GeneralRe: A question about OOP Pin
Jens Doose4-May-04 0:07
Jens Doose4-May-04 0:07 
GeneralRe: A question about OOP Pin
toxcct4-May-04 0:09
toxcct4-May-04 0:09 
GeneralRe: Template Pin
Antony M Kancidrowski3-May-04 23:13
Antony M Kancidrowski3-May-04 23:13 
GeneralRe: Template Pin
Jens Doose3-May-04 23:17
Jens Doose3-May-04 23:17 
GeneralRe: Template Pin
Anonymous3-May-04 23:39
Anonymous3-May-04 23:39 
GeneralRe: Template Pin
Jens Doose4-May-04 0:12
Jens Doose4-May-04 0:12 
GeneralRe: Template Pin
Antony M Kancidrowski4-May-04 2:53
Antony M Kancidrowski4-May-04 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.