私はC++プログラミングが新しくなっていますが、私はPythonとFreeBASICでSDLを広く使用しています。私はここに何か愚かな行方不明だと確信していますが、何を試しても私はエラーを取得し続けます "error:期待される初期化子の前に 'namespace'"私の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
ファイル全体が本当ですか?そのエラーの行番号が一致しません –