Public Group

Dev C++ #include error

This topic is 4769 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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.

Share on other sites
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(){}

Share on other sites
I put in a main function and it works fine.

Share on other sites
However, I still get the include error with SDL (atleast).

Share on other sites
That doesn't look like the full error message, was there anything after that?

Share on other sites
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

Share on other sites
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)

1. 1
2. 2
3. 3
frob
15
4. 4
5. 5

• 20
• 12
• 13
• 14
• 82
• Forum Statistics

• Total Topics
632144
• Total Posts
3004415

×