expected unqualified-id before "using" ??
Ok, I'm completly confused by this error.
Here is my main.cpp:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <windows.h>
#include <vector>
#include <iostream>
#include <SDL/SDL.h>
#include "map.h"
using std::vector;
SDL_Surface *screen = NULL;
vector<SDL_Surface*> images;
void init_imgs(vector<SDL_Surface*> &i)
{
SDL_Surface *temp;
temp = SDL_LoadBMP("img/grass.bmp");
i.push_back(temp);
temp = SDL_LoadBMP("img/water.bmp");
i.push_back(temp);
SDL_FreeSurface(temp);
}
int main (int argc, char *argv[])
{
char *msg;
int done;
if (SDL_Init (SDL_INIT_VIDEO) < 0)
{
sprintf (msg, "Couldn't initialize SDL: %s\n", SDL_GetError ());
MessageBox (0, msg, "Error", MB_ICONHAND);
free (msg);
exit (1);
}
atexit (SDL_Quit);
/*NOTE: Need a 32x24 array for tiles!*/
screen = SDL_SetVideoMode (1024, 768, 16, SDL_SWSURFACE | SDL_DOUBLEBUF);
if (screen == NULL)
{
sprintf (msg, "Couldn't set 640x480x16 video mode: %s\n",
SDL_GetError ());
MessageBox (0, msg, "Error", MB_ICONHAND);
free (msg);
exit (2);
}
SDL_WM_SetCaption ("War of Magic", NULL);
init_imgs(images);
Map *abc = new Map("level.txt", images, screen);
done = 0;
while (!done)
{
SDL_Event event;
/* Check for events */
while (SDL_PollEvent (&event))
{
switch (event.type)
{
case SDL_KEYDOWN:
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
}
return 0;
}
Now then, I keep getting the error
Code:
expected unqualified-id before "using"
expected "," or ";" before "using"
on the line:
I've searched google, google groups, and this board but couldn't find anything that seemed relevent to this problem. Can anybody here help?