我尝试使用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
代码开头的包含:
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <emscripten.h>
#include <stdio.h>
#include <string>
#include <sstream>
答案 0 :(得分:1)
#include <SDL/SDL.h>
包括emscripten内置SDL 1.3。
#include <SDL.h>
将使用emscripten-ports SDL2。