Dev C++ #include error

Started by
6 comments, last by ToastFlambe 18 years, 8 months ago
Ok, I've tried doing multiple searches for this and came up with nothing. Whenever I try to include a non standard C++ header (ie: iostream, string, vector, etc. work) I get an error that makes absolutely no sense. Example Code:

#include "SDL/SDL.h" 

int main( int argc, char *args[] ) 
{ 
   return 0; 
}

Error:

1 C:\Dev-Cpp\include\SDL\SDL.h:39,               from SDL1.cpp In file included from C:/Dev-Cpp/include/SDL/SDL.h:39,               from SDL1.cpp 
1 C:\Dev-Cpp\PROJECTS\SDL1\SDL1.cpp                  from SDL1.cpp 

This is not just a problem with SDL, it happens when I try to include anything, with the same error.
Advertisement
That is odd. SDL is weird for me as well, but if you are right and it does the same thing for all header files, than something is screwy. Try this as a test and tell us what happens (create these and put them in a project):

test.h
#ifndef TEST_HPP#define TEST_HPPvoid SomeFunction();#endif


test.cpp
#include "test.h"void SomeFunction(){}
my siteGenius is 1% inspiration and 99% perspiration
I put in a main function and it works fine.
However, I still get the include error with SDL (atleast).
That doesn't look like the full error message, was there anything after that?
ok, I didn't take a look at the lines after that. I think this is the real problem

97 C:\Dev-Cpp\include\SDL\SDL_audio.h syntax error before `[' token 


I don't see how there could be a problem with my SDL_audio file though, I downloaded (and redownloaded) off the main SDL page.

Here is the actual line that is supposedly causing the problem. I have a feeling it doesn't belong there at all as it is the only line without a comment describing what it does. Jack ass screwin up the DL? I dunno.

/* A structure to hold a set of audio conversion filters and buffers */typedef struct SDL_AudioCVT {	int needed;			/* Set to 1 if conversion possible */	Uint16 src_format;		/* Source audio format */	Uint16 dst_format;		/* Target audio format */	double rate_incr;		/* Rate conversion increment */	Uint8 *buf;			/* Buffer to hold entire audio data */	int    len;			/* Length of original audio buffer */	int    len_cvt;			/* Length of converted audio buffer */	int    len_mult;		/* buffer must be len*len_mult big */	double len_ratio; 	/* Given len, final size is len*len_ratio */	void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);   <<<this one	int filter_index;		/* Current audio conversion function */} SDL_AudioCVT;
shameless bump
Hmmm...in my SDL_audio.h file line 97 is this
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);

maybe you can try taking out that SDLCALL? (make a copy of the original file before messing with it though)

This topic is closed to new replies.

Advertisement