所以,我对C++编程相当新,但我已经将SDL广泛用于python和FreeBASIC.我确定我在这里遗漏了一些愚蠢的东西,但无论我尝试什么,我都会在我的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 …Run Code Online (Sandbox Code Playgroud)