Hi, On Thu, Jul 3, 2014 at 3:44 PM, amir nouri <[email protected]> wrote: > Hello, > > When i try to run hello_image_sdl sample , image doesn't load , (with > --preload) > > error : IMG_Load: unknown sdl-emscripten error >
You need to be in the emscripten/tests/ directory before cross compiling, otherwise when you do - $ emcc tests/hello_image_sdl.c --preload-file tests/screenshot.jpg -o a.html the image file is stored at "tests/screenshot.jpg" and not "/screenshot.jpg" which causes the IMG_Load to fail. Alternatively you can do the following - $ emcc tests/hello_image_sdl.c --preload-file tests/screenshot.jpg@/ -o a.html which makes emscripten store the file "/screenshot.jpg". For more information, see - https://github.com/kripken/emscripten/wiki/Tutorial#using-files and https://github.com/kripken/emscripten/wiki/Filesystem-Guide#packaging-files Hope that helps, --Sathya -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
