Coder Social home page Coder Social logo

Comments (1)

Dolphindalt avatar Dolphindalt commented on May 26, 2024

I also happen to be trying to compile SDL using the simple2d.sh script on a raspberry pi and have encountered the same error. I have determined that the installation is failing because SDL fails to compile during the installation process due to a compile error.

/tmp/SDL2-2.0.10/src/video/SDL_egl.c: In function 'SDL_EGL_LoadLibrary':
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:26: warning: implicit declaration of function 'access'; did you mean 'Success'? [-Wimplicit-function-declaration]
  268 |     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
      |                          ^~~~~~
      |                          Success
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:53: error: 'F_OK' undeclared (first use in this function)
  268 |     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
      |                                                     ^~~~
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:53: note: each undeclared identifier is reported only
once for each function it appears in
make: *** [Makefile:530: build/SDL_egl.lo] Error 1

==> Installing

/bin/bash build-scripts/updaterev.sh
  CC     build/SDL_egl.lo
/tmp/SDL2-2.0.10/src/video/SDL_egl.c: In function 'SDL_EGL_LoadLibrary':
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:26: warning: implicit declaration of function 'access'; did you mean 'Success'? [-Wimplicit-function-declaration]
  268 |     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
      |                          ^~~~~~
      |                          Success
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:53: error: 'F_OK' undeclared (first use in this function)
  268 |     SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK));
      |                                                     ^~~~
/tmp/SDL2-2.0.10/src/video/SDL_egl.c:268:53: note: each undeclared identifier is reported only
once for each function it appears in
make: *** [Makefile:530: build/SDL_egl.lo] Error 1

There is a bug tracking thread where others are having a similar issue when trying to compile SDL for the raspberry pi.

This issue on Github claims to have fixed the issue by including unistd.h in SDL_egl.c, because unistd.h includes the definitions of access and F_OK.

Perhaps the simplest way to resolve this is to compile a more recent version of SDL that includes the patches made from both of the previous links. Any SDL release after November of 2021 should suffice.

I used the most recent version 2.0.22 by changing one line in the simple2d.sh script:

sdl_fname="SDL2-2.0.22"
sdl_url="${libsdl_url}/release/${sdl_fname}.tar.gz"

This change compiled SDL successfully without the previous error.

SDL_Mixer also does not compile with the error.

music.c:43:10: fatal error: native_midi/native_midi.h: No such file or directory
   43 | #include "native_midi/native_midi.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:149: build/music.lo] Error 1

I changed to a more recent SDL_Mixer version to solve this one as there was no documentation of others having this issue. The simple2d.sh script pulls all SDL releases from https://www.libsdl.org, but new releases for SDL_Mixer are no longer posted there, so I pulled from the Github repository instead.

If libsdl.org is no longer including the most recent releases, perhaps it is time to use the Github releases for the script.

from simple2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.