저는 C++ 프로그래밍을 처음 접했지만 파이썬과 FreeBASIC에서 광범위하게 SDL을 사용했습니다. 나는 바보 같은 뭔가를 놓치고있다. 그러나 나는 무엇을 시도하든 계속 오류가 발생한다. "오류 : 예상되는 이니셜 라이저가 '네임 스페이스'보다 먼저 내 video.h 파일에있다. 그것은 나를 조금 미치게합니다.네임 스페이스 이전에 예상되는 초기화 프로그램
#include "SDL/SDL.h"
#include <iostream>
namespace video {
// This is here because like video, everything uses it and the players should never be able to touch it.
int rolldice(int minimumroll, int maximumroll, int numberofdice);
// Same Here.
char* charraystring(std::string prestring);
// Now we're in video proper
// This function loads an image, checks to make sure it works, returns the image, and unloads the testing surface.
SDL_Surface* loadimage(std::string path);
// This is an optimized blitter that will exit with a signal if it encounters an error.
void oblit(SDL_Surface* pic, SDL_Rect frame, SDL_Surface* screen, SDL_Rect location);
}
오류는 무엇입니까? –
Line 4. 실제 오류 메시지는 /home/dyngar/Workspace/C/CLAIR/video.h:4:1입니다. 오류 : 'namespace'이전의 예상 초기화 프로그램입니다. 죄송합니다. 이전 버전의 파일에서 오류를 복사했습니다. – Jsmith
전체 파일이 확실합니까? 해당 오류의 줄 번호가 일치하지 않습니다 –