为什么我的代码运行不起来?是我哪写错了吗?(SFML/C++)

我在写俄罗斯方块的时候写到了和显示文字有关的函数,我用了指针传RenWindow* window参数,然后莫名其妙的

img

SFML/C++
环境:windows 10, visual studio 2022

void SettingButton::draw(RenderWindow* window, float posX, float posY) {
    Text text;
    FloatRect box = subButton.buttonSprite.getGlobalBounds();
    //subButton是一个Sprite
    text.setFont(font);
    text.setString(L"wtf");
    text.setPosition(posX + box.width * 2, posY);
    window->draw(text);
}