代码块 ld.exe 图像错误,带有 png 扩展名代码块中的 2D 图形

问题描述

enter image description here[错误显示在图像中][1]我在代码块项目目录中添加文件

>>>>Texture t1,t2,t3;
    t1.loadFromFile("background.png");
    t2.loadFromFile("car.png");
    t1.setSmooth(true);
    t2.setSmooth(true);

    Sprite sBackground(t1),sCar(t2);
    sBackground.scale(2,2);

无法加载背景和汽车 png。

解决方法

从项目中删除 .depend 和 .png 文件,因为它们不是源文件。