小编Edm*_*yle的帖子

为什么SDL_image不起作用

我是C++和SDL的新手; 我正在尝试使用此处的说明添加新的SDL扩展库:http://www.lazyfoo.net/SDL_tutorials/lesson03/windows/devcpp/index.php

但我得到这些错误:

3 C:\ Documents and Settings\Edmund\My Documents\C++\myprojects\SDL\SDLevent.cpp SDL/SDL_image.h:没有这样的文件或目录.

C:\ Documents and Settings\Edmund\My Documents\C++\myprojects\SDL\SDLevent.cpp在函数`SDL_Surface*load_image(std :: string)'中:

28 C:\ Documents and Settings\Edmund\My Documents\C++\myprojects\SDL\SDLevent.cpp`IMG_Load'unclaclared(首次使用此功能)

然后是一堆不合格的ID.

这是我的代码:

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"

#include <string>

//Screen attributes
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_BPP = 32;

//The surfaces
SDL_Surface *image = NULL;
SDL_Surface *screen = NULL;

//The event structure that will be used
SDL_Event event;

SDL_Surface *load_image( std::string filename ) 
{
    //The image that's loaded …
Run Code Online (Sandbox Code Playgroud)

c++ sdl

1
推荐指数
1
解决办法
5138
查看次数

标签 统计

c++ ×1

sdl ×1