emscripten-ports / SDL2

Other
166 stars 64 forks source link

error: implicit declaration of function 'REPORT_RESULT' is invalid in C99 #9

Closed paldepind closed 9 years ago

paldepind commented 9 years ago

I've installed Emscripten as per the instructions.

However, when I try to compile any of SDL2 tests I get the following error:

$ ./emcc tests/sdl2_mouse.c -s USE_SDL=2 -o out.js
tests/sdl2_mouse.c:30:11: error: implicit declaration of function 'REPORT_RESULT' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
          REPORT_RESULT();
          ^
1 error generated.
ERROR    root: compiler frontend failed to generate LLVM bitcode, halting

The error seems to be related to this resolved issue.

kripken commented 9 years ago

The tests integrate into the test suite using that command, they aren't meant to be run standalone. But you can remove that line to make them work.

To run them from the test suite, you can do e.g. tests/runner.py browser.test_sdl2_image

paldepind commented 9 years ago

Ok. I simply assumed they where examples I could compile and run. I probably got that impression since the tutorial told me to compile the hello_world.c file in the example directory as if it was an example program. Looking at some of the other files in the directory they appear to be example programs as well.

Maybe creating an examples directory specifically for the demonstration programs would be a good idea? Mixing tests an examples seems odd to me.

kripken commented 9 years ago

Yeah, I suppose it could be confusing. For now I explained this in the tutorial. But maybe we should indeed create an examples/ folder.

On Sun, Feb 22, 2015 at 9:18 AM, Simon Friis Vindum < notifications@github.com> wrote:

Ok. I simply assumed they where examples I could compile and run. I probably got that impression since the tutorial told me to compile the hello_world.c file in the example directory as if it was an example program. Looking at some of the other files in the directory they appear to be example programs as well.

Maybe creating an examples directory specifically for the demonstration programs would be a good idea? Mixing tests an examples seems odd to me.

— Reply to this email directly or view it on GitHub https://github.com/emscripten-ports/SDL2/issues/9#issuecomment-75445904.