입니다. 코드의 int main() 세그먼트에서 식별자 (타일)를 선언했습니다. 어떤 라인에서는 식별자가 선언되지 않았다고 생각하고, 다른 라인에서는 선언을 인식합니다. 초기 선언은 모든 대괄호 (메인을 제외한) 밖입니다. 이것은 왜 발생 하는가? 또는 내 오류 코드는 줄 곳 그건 적어도 -식별자가 선언 된 부분과 선언되지 않은 부분이 모두 C2065 VS2010 C++
int main(int argc, char* args[])
{
//Quit flag
bool quit = false;
//The dot
Dot myDot;
//The tiles that will be used
Tile *tiles[ TOTAL_TILES ];
//The frame rate regulator
Timer fps;
//Initialize
if(init() == false)
{
return 1;
}
//Load the files
if(load_files() == false)
{
return 1;
}
//Clip the tile sheet
clip_tiles();
//Set the tiles
if(set_tiles(tile) == false)
{
return 1;
}
//While the user hasn't quit
while(quit == false)
{
//Start the frame timer
fps.start();
//While there's events to handle
while(SDL_PollEvent(&event))
{
//Handle events for the dot
myDot.handle_input();
//If the user has Xed out the window
if(event.type == SDL_QUIT)
{
//Quit the program
quit = true;
}
}
//Move the dot
myDot.move(tiles);
//Set the camera
myDot.set_camera();
//Show the tiles
for(int t = 0; t < TOTAL_TILES; t++)
{
tiles[ t ]->show();
}
//Show the dot on the screen
myDot.show();
//Update the screen
if(SDL_Flip(screen) == -1)
{
return 1;
}
//Cap the frame rate
if(fps.get_ticks() < 1000/FRAMES_PER_SECOND)
{
SDL_Delay((1000/FRAMES_PER_SECOND) - fps.get_ticks());
}
}
//Clean up
clean_up(tile);
return 0;
}
내 문제는 clean_up (tile);
및 set_up (tile);
함께.
오류 메시지/스택 추적을 포함 – eebbesen