この関数は完全に正常に動作するか、コンパイラ/デバッガが教えてくれます
void GUIManager::init(ToScreen* tS)
{
    toScreen = tS;
    loadFonts();
    GUI_Surface = SDL_SetVideoMode( toScreen->width, toScreen->height, 32, SDL_SWSURFACE );
    components.push_back(&PlainText("Hello, World!", font, -20, -40));
}
ここでは、最初の関数呼び出しでアクセス違反エラーが発生します。デバッガーには問題はありません。プログラムがここで停止するため、コンポーネント [0] をデバッグする機会がありません。
void GUIManager::draw() 
{
    // This line here is the problem
    components[0].draw(GUI_Surface);
    // This line here is the problem
    SDL_BlitSurface(GUI_Surface, NULL, toScreen->Screen_Surface, NULL);
}
必要な場合に備えて、これは私の「コンポーネント」です
boost::ptr_vector<GUIComponent> components;
他のコードが必要な場合はお知らせください。おそらく、PlainText、または GUIComponent のものです。