所以,我对 C++ 编程相当陌生,但我已经在 python 和 FreeBASIC 中广泛使用了 SDL。我确定我在这里遗漏了一些愚蠢的东西,但无论我尝试什么,我都会在我的 video.h 文件中收到错误“错误:'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);
}