Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

SDL Build errors under Mac OS X 10.9 Mavericks #28

Open
Happy-Ferret opened this issue Oct 7, 2015 · 3 comments
Open

SDL Build errors under Mac OS X 10.9 Mavericks #28

Happy-Ferret opened this issue Oct 7, 2015 · 3 comments

Comments

@Happy-Ferret
Copy link

Trying to compile emscripten-scummvm under Mac OS X 10.9 yields the following errors.

Am I assuming correctly that it requires older SDL headers I might be lacking or is this something entirely different?

I've also tried building this with an older emscripten fork (the one hosted in one of your repositories), hoping this was simply an architectural change in the newer releases of emscripten.

Unfortunately, to no avail.

C++      backends/platform/sdl/sdl.o
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:26:
./backends/platform/sdl/sdl-sys.h:55:10: error: 'SDL.h' file not found with
      <angled> include; use "quotes" instead
#include <SDL.h>
         ^~~~~~~
         "SDL.h"
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:28:
In file included from ./backends/modular-backend.h:26:
In file included from ./backends/base-backend.h:31:
In file included from ./common/events.h:28:
In file included from ./common/rect.h:27:
In file included from ./common/util.h:26:
./common/str.h:83:3: warning: anonymous types declared in an anonymous union are
      an extension [-Wnested-anon-types]
                struct {
                ^
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:29:
./backends/mixer/sdl/sdl-mixer.h:70:2: error: unknown type name 'SDL_AudioSpec'
        SDL_AudioSpec _obtained;
        ^
./backends/mixer/sdl/sdl-mixer.h:78:10: error: unknown type name 'SDL_AudioSpec'
        virtual SDL_AudioSpec getAudioSpec(uint32 rate);
                ^
In file included from backends/platform/sdl/sdl.cpp:31:
In file included from ./backends/platform/sdl/sdl.h:30:
./backends/events/sdl/sdl-events.h:77:2: error: unknown type name 'SDL_Joystick'
        SDL_Joystick *_joystick;
        ^
./backends/events/sdl/sdl-events.h:90:32: error: unknown type name 'SDL_Event'
        virtual void preprocessEvents(SDL_Event *event) {}
                                      ^
./backends/events/sdl/sdl-events.h:95:32: error: unknown type name 'SDL_Event'
        virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
                                      ^
./backends/events/sdl/sdl-events.h:106:29: error: unknown type name 'SDL_Event'
        virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
                                   ^
./backends/events/sdl/sdl-events.h:107:27: error: unknown type name 'SDL_Event'
        virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
                                 ^
./backends/events/sdl/sdl-events.h:108:33: error: unknown type name 'SDL_Event'
        virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
                                       ^
./backends/events/sdl/sdl-events.h:109:37: error: unknown type name 'SDL_Event'
        virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
                                           ^
./backends/events/sdl/sdl-events.h:110:35: error: unknown type name 'SDL_Event'
        virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:111:35: error: unknown type name 'SDL_Event'
        virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:112:33: error: unknown type name 'SDL_Event'
        virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
                                       ^
./backends/events/sdl/sdl-events.h:113:35: error: unknown type name 'SDL_Event'
        virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
                                         ^
./backends/events/sdl/sdl-events.h:128:24: error: unknown type name 'SDL_Event'
        virtual bool remapKey(SDL_Event &ev, Common::Event &event);
                              ^
./backends/events/sdl/sdl-events.h:133:21: error: unknown type name 'SDLKey'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                           ^
./backends/events/sdl/sdl-events.h:133:33: error: unknown type name 'SDLMod'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                                       ^
./backends/events/sdl/sdl-events.h:133:45: error: unknown type name 'Uint16'
        virtual int mapKey(SDLKey key, SDLMod mod, Uint16 unicode);
                                                   ^
./backends/events/sdl/sdl-events.h:138:39: error: unknown type name 'SDLMod'
        virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event);
                                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [backends/platform/sdl/sdl.o] Error 1
@juj
Copy link
Owner

juj commented Oct 7, 2015

Yeah, it's been a long time since I built this repository, and something has changed since. Try perhaps changing the include to #include <SDL/SDL.h>, that might work. The intent is that it should pick up the Emscripten-provided SDL "1.4" header (here https://github.com/kripken/emscripten/blob/master/system/include/SDL/SDL.h), as opposed to a precompiled SDL 2 or something installed to the system.

@Happy-Ferret
Copy link
Author

Thanks.

One step closer. Now I'm getting this (on both Mac and GNU/Linux, btw).

    C++      base/main.o
In file included from base/main.cpp:39:
In file included from ./engines/engine.h:26:
./common/str.h:83:3: warning: anonymous types declared in an anonymous union are
      an extension [-Wnested-anon-types]
                struct {
                ^
base/main.cpp:364:2: error: use of undeclared identifier 'emscripten_async_call'
        emscripten_async_call(emscriptenUpdate, 0, 1);
        ^
base/main.cpp:373:6: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/dott")) { args[1] = "-p/dott"; args[2] = "...
            ^
base/main.cpp:374:13: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/monkey")) { args[1] = "-p/monkey"; args[2...
            ^
base/main.cpp:375:13: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/samnmax")) { args[1] = "-p/samnmax"; args[...
            ^
base/main.cpp:376:13: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/atlantis")) { args[1] = "-p/atlantis"; arg...
            ^
base/main.cpp:377:13: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/indy3")) { args[1] = "-p/indy3"; args[2] ...
            ^
base/main.cpp:378:13: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/comi")) { args[1] = "-p/comi"; args[2] = "comi"; }
            ^
base/main.cpp:379:6: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/loom")) { args[1] = "-p/loom"; args[2] = "loom"; }
            ^
base/main.cpp:380:6: error: use of undeclared identifier 'directoryExists'
        if (directoryExists("/maniac")) { args[1] = "-p/maniac"; args[2...
            ^
1 warning and 9 errors generated.
make: *** [base/main.o] Error 1

When I manually call em++, I'm told that I'm missing components such as the correct LLVM version required by emscripten, so I assume I'm simply missing parts of the toolchain.

Setting it all up as per the following instructions now.
http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html

EDIT: Now I'm really confused.
Isn't the SDK supposed to install the emscripten specific version of LLVM?
Literally the first message I get when launching the installer is that it can't find the emscripten specific version of LLVM.

@ccarpo
Copy link

ccarpo commented Sep 10, 2016

I got the same problems. I changed the SDL.h include manually which brought me to the "undeclard identifier error. Any recommendations how to proceed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants