所以,我對C++編程相當陌生,但我已經廣泛地使用了SDL和python和FreeBASIC。我敢肯定,我在這裏錯過了一些愚蠢的東西,但不管我嘗試了什麼,我一直在我的video.h文件中收到錯誤「error:'namespace'之前的預期初始化器」。這讓我有點瘋狂。命名空間前的預期初始化器
#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);
}
錯誤在哪一行? – 2012-02-01 21:16:02
第4行。實際的錯誤消息是/home/dyngar/Workspace/C/CLAIR/video.h:4:1:錯誤:'namespace'之前的預期初始化程序對不起,我從舊版本的文件複製錯誤。 – Jsmith 2012-02-01 21:17:06
你確定這是你的整個文件嗎?該錯誤中的行號不匹配 – 2012-02-01 21:18:06