Menu

#686 OS X: "Did not find libSDL or SDL.lib" at compilation

SDL
closed
nobody
SDL (4) osx (2)
2
2017-08-20
2015-01-15
Audiophilip
No

Running OS X 10.10 w/ Apple Clang v6. I installed scons (2.3.4) and SDL (1.2.15) via Homebrew.

Upon running scons I get:

scons: Reading SConscript files ...
platform: darwin
Checking for C library dw... no
Checking for C function asprintf()... yes
Checking for inflate in C library z... yes
Checking for C library SDL... no
Did not find libSDL or SDL.lib, exiting!

Thank you for your help in advance!

Discussion

  • Lukas Sabota

    Lukas Sabota - 2015-01-15
    • labels: SDL --> SDL, osx
    • Priority: 5 --> 2
     
  • Lukas Sabota

    Lukas Sabota - 2015-01-15

    Thanks for opening this issue. I no longer have access to an OSX machine (and neither do any of the other SDL devs AFAIK) so I'm unable to look into this. You might want to try clearing your scons cache . If you find a solution for your issue feel free to post it here, but I'm unable to look into this issue

     
  • Audiophilip

    Audiophilip - 2015-01-15

    Thanks for the quick answer!

    In the meantime I managed to make the include and lib directories visible to scons with:

    CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib scons
    

    But then it halts at trying to execute pkg-config:

    scons: Reading SConscript files ...
    platform:  darwin
    Checking for C library dw... no
    Checking for C function asprintf()... yes
    Checking for inflate in C library z... yes
    Checking for C library SDL... yes
    Checking for C library GL... no
    base CPPDEFINES: ['PUBLIC_RELEASE', ['_GNU_SOURCE', '1'], '_THREAD_SAFE', 'PSS_STYLE=1', 'LSB_FIRST', 'FRAMESKIP']
    base CCFLAGS: -Wall -Wno-write-strings -Wno-sign-compare -I/usr/local/include -DHAVE_ASPRINTF
    /bin/sh: pkg-config: command not found
    OSError: 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ pkg-config --cflags --libs x11' exited 127:
      File "[redacted]/fceux-2.2.2/SConstruct", line 189:
        fceux = SConscript('src/SConscript')
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 614:
        return method(*args, **kw)
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 551:
        return _SConscript(self.fs, *files, **subst_kw)
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 260:
        exec _file_ in call_stack[-1].globals
      File "[redacted]/fceux-2.2.2/src/SConscript", line 33:
        platform_files = SConscript('drivers/sdl/SConscript')
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 614:
        return method(*args, **kw)
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 551:
        return _SConscript(self.fs, *files, **subst_kw)
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Script/SConscript.py", line 260:
        exec _file_ in call_stack[-1].globals
      File "[redacted]/fceux-2.2.2/src/drivers/sdl/SConscript", line 7:
        env.ParseConfig(config_string)
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Environment.py", line 1579:
        return function(self, self.backtick(command))
      File "/usr/local/Cellar/scons/2.3.4/libexec/scons-local/SCons/Environment.py", line 597:
        raise OSError("'%s' exited %d" % (command, status))
    

    Maybe someone can chip in and see if we can solve this together. In case I can solve it, I'll report back.

    Thanks again!

     

    Last edit: Audiophilip 2015-01-15
  • Lukas Sabota

    Lukas Sabota - 2015-01-15

    you should be able to "brew install pkg-config"

    pkg-config should be a dependency in the brew recipie but I don't think it is

     
  • Audiophilip

    Audiophilip - 2015-01-15

    OK, now I have it: making sure I have both X11 and 'pkg-config` installed (actually, you get the latter as well by installing X11), I could successfully build fceux. Yay! Problem solved.

    So again, for the sake of clarity: the solution to the problem in the title is: make sure to set CFLAGS and LDFLAGS environment variables to the right paths before running scons.

     

    Last edit: Audiophilip 2015-01-19
  • zeromus

    zeromus - 2015-01-15

    FWIW this seems strangely familiar to me. I've debugged something related to this recently, but it was in linux. I think around that time I made some edits to the scons scripts, but I'm not sure I fixed everything. I dont remember all the details

     
  • Lukas Sabota

    Lukas Sabota - 2015-01-15

    I can't reproduce on Arch Linux, but if you are able to reproduce this on linux, let me know what distribution and version - and check that the development package for sdl is installed (the one with headers, etc) and diagnose

     
  • Lukas Sabota

    Lukas Sabota - 2016-03-29

    This bug has been sitting around for over a year now so I am going to close it. Feel free to re-open this is anyone cares, but none of the fceux team has apple hardware or access to OSX to be able to test any of this so I'm not sure how much help we can be.

    I wrote a homebrew recipie for fceux while I was borrowing a mac one day and that worked at the time. I would recommend starting from there and tweaking the recipie to work for your particular version of OSX.

     
  • Lukas Sabota

    Lukas Sabota - 2016-03-29
    • status: open --> closed
     
  • Tom Piercy

    Tom Piercy - 2017-08-20

    Just to append to the above, I also needed to set the CFLAGS and LDFLAGS, but additionally had to add import the PATH from the external environment. See http://scons.org/doc/1.2.0/HTML/scons-user/x1673.html I use Mac Ports which installs most things under /opt/local. Blank environments rarely include that by default.

    I wound up using the line env = Environment(options = opts, ENV=os.environ), though I suspect env = Environment(ENV = {'PATH' : os.environ['PATH']}) is sufficient.

     

    Last edit: Tom Piercy 2017-08-20

Log in to post a comment.