Jump to content
  • Advertisement
Sign in to follow this  
Ceoddyn

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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_HPP

void SomeFunction();

#endif




test.cpp

#include "test.h"

void SomeFunction()
{}


Share this post


Link to post
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;

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!