【发布时间】: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