【问题标题】:Unknown type name "SDL_RendererFlip" using SDL2 (emscripten)使用 SDL2 (emscripten) 的未知类型名称“SDL_RendererFlip”
【发布时间】:2016-09-30 19:36:31
【问题描述】:

我尝试使用 emscripten 编译此 SDL2 教程:Text input tutorial

但是我遇到了这个错误:

error: unknown type name 'SDL_RendererFlip'; did you mean 'SDL_RendererFlags'?
error: use of undeclared identifier 'SDL_RenderCopyEx'

<SDL/SDL.h> 包括在内。我不知道为什么编译器找不到枚举和函数。

https://wiki.libsdl.org/SDL_RendererFlip
https://wiki.libsdl.org/SDL_RenderCopyEx


命令行参数是:

emcc main.cpp -o main.html --preload-file files@/ -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS=['bmp'] -s USE_SDL_TTF=2

代码开头的includes:

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <emscripten.h>
#include <stdio.h>
#include <string>
#include <sstream>

【问题讨论】:

    标签: javascript c++ sdl-2 emscripten


    【解决方案1】:

    #include &lt;SDL/SDL.h&gt; 包含 emscripten 内置 SDL 1.3。

    #include &lt;SDL.h&gt; 将使用 emscripten-ports SDL2。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-26
      • 1970-01-01
      • 2013-06-26
      • 1970-01-01
      • 2014-11-19
      • 2018-10-27
      • 2016-09-16
      相关资源
      最近更新 更多