Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Error C1075 end of file found before...

This thread is locked; no one can reply to it. rss feed Print
Error C1075 end of file found before...
novello
Member #13,863
December 2011

My problem is that i do not have 74 lines of code in my map class so wtf is going on?

Error 1 error C1075: end of file found before the left brace '{' at 'c:\users\frank novello\documents\visual studio 2010\projects\platformer\platformer\map.cpp(51)' was matched

File: map.cpp

Line: 74

#SelectExpand
1#include "Map.h" 2#include <fstream> 3#include "Global.h" 4 5using namespace std; 6 7 8 9Map::Map(void) 10{ 11} 12 13 14Map::~Map(void) 15{ 16} 17 18void Map::Init() 19{ 20 loadCounterX = loadCounterY; 21 Map::LoadMap("Map1.txt"); 22} 23 24void Map::Update() 25{ 26 27} 28 29void Map::Draw(BITMAP *Buffer) 30{ 31 for (int i = 0; 1 < mapSizeX; i++) 32 { 33 for (int j = 0; j < mapSizeY; j++) 34 { 35 if (MapFile[i][j] == 1) 36 { 37 rectfill(Buffer, i*BlockSize, j*BlockSize, i*BlockSize + BlockSize, 38 j*BlockSize + BlockSize, makecol (0, 255, 255)); 39 } 40 else if (MapFile[i][j] == 2) 41 { 42 rectfill(Buffer, i*BlockSize, j*BlockSize, i*BlockSize + BlockSize, 43 j*BlockSize + BlockSize, makecol (0, 255, 0)); 44 } 45 46 } 47 } 48} 49 50void Map::LoadMap(const char *filename) 51{ 52 ifstream openfile (filename); 53 if (openfile.is_open()) 54 { 55 openfile >> mapSizeX >> mapSizeY; 56 while (!openfile.eof()) 57 { 58 openfile >> MapFile[loadCounterX][loadCounterY]; 59 loadCounterX ++; 60 61 if (loadCounterX >= mapSizeX) 62 { 63 loadCounterX = 0; 64 loadCounterY ++; 65 } 66 67 } 68 loadCounterX = loadCounterY = 0; 69 } 70 else 71 { 72 allegro_message ("Map File Not Found"); 73 }

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

GullRaDriel
Member #3,861
September 2003
avatar

facepalm

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Go to: