how to install to Raspberry Pi 2 (XWindows, Jessie, Geany IDE, C(++)11

can you please decribe how to install raylib to Raspberry Pi 2 (old) / Jessie?
most possibly by sth like apt-get install or git clone or a installation script which does all the downloads, create directories, and all make/makefile or whatever what one needs.
I have to compile by gpp C(++)11 because of different additional IO/shield libs which create C++(11) object instances.
I want to run my compiled programs in Xwindows (not full-screen) and compile/build/start it out of the Geany IDE.
Will it be possible to achieve that?


  • If you adapt the instructions from using PLATFORM_DESKTOP, it can work. I also found to be helpful.

    If you're using the Makefiles, it's pretty straightforward to configure your build targets in Geany. I haven't tried configuring for the alternative CMake system.
  • edited January 21
    the instructions at the first link are way too complicated and cumbersome, and I never use cmake.
    I also never use makefiles by my own, just Geany with -I and -l flags..
    Instead, there should exist a all-in-one installation setup program, similar to what one is used to for installing Windows pograms by arbitrary setup.exe tools.
    But when I read through I honestly am totally puzzled and confused and don't understand actually a single line.
    So something like just a simple
    apt-get install raylib
    would be highly appreciated which does all the installation steps out of the box, including all helper libs and compilations.
    Having said that, I still am uncertain if raylib generally is fully gpp C(++)11 compliant though.
  • edited January 23
    I understand. Linux, feel the pai...ower! But seriously, the idea is out there and I agree that such a package would be very nice. The issue is that raylib can be configured in so many ways. It's a great feature but it can also be a hurdle if you just want to play-program some games. If you want an educational package like the Windows version with Notepad++, that's one thing. It's what Ray uses and supports. On the GNU/Linux side, he supports us in code and has given us good documentation but it's up to us to make anything more with it. raylib fits well with the educational goals of the Pi and the idea of a Raspberry Pi package is attractive. It just a needs a sufficiently skilled and motivated human to make it happen.

    Did you work through any of the installation, dependencies, etc... You're using a Pi 2 with Jessie? If you were on Stretch, you could skip the Cmake part and compiling GLFW and just apt-get whatever the glfw3 packages are called, libglfw3 and libglfw3-dev or something, along with the rest of the dependencies. Just make sure your glfw is version 3.2.1 or better. Not 3.1.2, which is what Jessie probably came with. Then you will have to change your -lglfw3 to -lglfw in your example/Makefile because GLFW has different names depending on whether it's compiled as a shared library, like in a Linux distro package, or a static library which is what Ray's instructions lead to, in which case you won't need to change that soname in the makefile. So yeah, it's complex, but it works. I learned a ton getting it to run.

    Ray has been trying to simplify and reduce dependencies and development versions of raylib have GLFW and sound included. I haven't played with that setup but things are getting better for your use case. might work for you in some way. Anyway, I hope you give raylib another try.

    BTW, In addition to having much more up-to-date packages, Stretch is Noticeably faster and more stable than Jessie on all my hardware. Recommended.
    `sudo apt update && sudo apt dist-upgrade` if you don't want to mess with a new image.

    duckduck Voxatron for hoopty
  • edited January 23
    Derp from above
    "It just needs sufficiently skilled and motivated humans to make it happen." is a better way of saying that.

    Oh yeah, raylib is C99 with accommodations for C++. Aren't newer standards just add-ons to the old standard? That is to say, I think raylib will run fine with your C++11 features. It just doesn't make use of them itself. I think. I personally have never mixed C and C++ so you may have issues I don't know about. I wouldn't worry though, raylib runs on almost anything.
  • edited January 23
    thank you, but as stated, I just have Jessie, and there is no upgrade tool for Jessie to Stretch. Unfortunately I have far too many programs and settings installed by my own, it would take me weeks or months to achieve all that for a new installation from the scratch. Additionally, the manufacturer of my robot IO shield also supports just Jessie, not Stretch so far.
    About C99 and C(++)11, I am quite sure that they are not 100% compatible to each other, but that may not concern raylib compellingly - nonetheless I read somewhere that raylib needed -std=c99 for some examples, but I don't know for which ones actually.
    I am also used to the simplicity of the Arduino IDE and to Geany on the Pi to #include just a header file and then perhaps link by -l and -I, as I already stated - so I never use makefiles by my own, I even have no idea, how they work at all. They exist somehow, ok, but far too complicated for my skills. I also have no idea about glfw3 packages or distro or static libs or whatever.
    So what I need is a .h file and a .c file or a .so file to copy into an arbitrary directory - or a setup function which does all that for me.
    OTOH, raylib looked very easy and handsome from the first glance, and I am sure I can handle a lot of things very successfully with it's high-level API, not being forced to mess around with all the low level things beneath, but I need the same simplicity also already for it's installation.
    As long as that does not exist, I will have to abandon that whole raylib thing unfortunately.
  • edited January 23
    Thanks for your feedback. Is there another pre-configured project using Geany that I could look at? For raylib, there are a few different build targets with various options. I might trying wiring those up to some Build tools and publishing the configuration. One issue is that Geany isn't distributed with the same set of plugins in various distributions and could require some initial user setup. Targeting just the Pi simplifies it. If it works out, would you be willing to test it? Do you use the Project plugin with Geany?

    As far as getting a binary, make is your friend and worth knowing just for it's ubiquity.
  • edited January 23
    so far I am using in my projects
    openCV (basic steps for color recognition)
    plus different device libs (I2C, UART, SPI, 1-wire) for IO shields, sensors, port multiplexers, a.s.o.

    I tried but failed with gtkiostream, although it's easy to install I must say that it's a 1-man-project providing just very poor support.

    for compile/build, my Geany setting perhaps look like this:
    g++ -Wall -pthread -I/opt/vc/include -lshapes -o "%e" "%f" -lwiringPi $(pkg-config --cflags --libs opencv)

    additionally, for gtkiostream (abandoned):
    $(pkg-config gtk+-2.0 --cflags --libs) -I/home/pi/gtkiostream-1.5.0/include

    of course I'll gladly test your new simplifications - but don't expect too much, I am just a hobby programmer by sort of Arduino user skills ;)
  • Cool. I'm just a player too, trying to stay in the game. I'm not experienced with those libraries but I'd like to be. I'll come back later with some more info. In the meantime, if you're interested,
  • Hello oneou! Welcome to the forum. I agree that raylib is not easy to setup on Raspberry Pi for a non-experienced user. My students work on Windows platform, so, I created a portable installer for them on that platform... but creating and maintaining that kind of package requires lot of work.

    Rider8, many thanks for your answers helping with this problem!
  • edited January 25
    probably it would help already if you provide a bash script for all installation steps, one after the other (including all the installations of all basic graphic libs and tools, intermediate compilations, and deletions of all temporary files and dirs) which are needed. As you are supposed to know what one needs, you just would have to write them one beneath the other.
    If one step fails, then retry or exit with a error message, else goto the next step.
    Then one wouldn't need to read through all the confusing details but instead just start the script, e.g. by ./
    As to uninstall or update, there should exist additional bash scripts, too.
  • That would be great, contributions are really welcomed!
  • edited January 26
    I tend to think of make and the Makefiles as the scripting system. src/Makefile contains options covering all the many official use cases and examples/ , games/ , and templates/ Makefiles give examples of how to organize your own project code. One just feeds `make` whatever options one wants. Knowing those options is the key thing. You'll be reading the code anyway, why not start with src/Makefile? It's low-level Spartan programming, as advertised. raylib can manifest in a lot of ways, it sometimes breaks my brain. With all that said, streamlining installation has been on the radar for a while. Ray is looking at including GLFW along with some other new things in the next release so installation should become simpler. I imagine the instructions will be updated as needed then.You can see what he's up to on the develop branch at github.

    If you can get GLFW compiled and all the dependencies installed, to build raylib your command will be something like,


    Since PLATFORM_DESKTOP is the default in the Makefile, you could use shorten it to
    `make GRAPHICS=GRAPHICS_API_OPENGL_21` or even uncomment your desired graphics option in the makefile before running just `make` . Then `sudo make install`

    Now go looking for fun stuff..

    `cd ../examples`
    `make GRAPHICS=...`

    `cd ../games/`

    In the end, your personal makefile will have all your options including -L and -I stuff in it and you don't need Geany anymore.

    To me, having to compile GLFW because Ubuntu 16.04 and other Debian 8 (Jessie) derivatives like Raspbian have an old version was the first big hurdle. If I had never done something like that before, I probably would have clicked through... and missed out on learning some deeper fundamentals. It was what I was looking for, so it's worked out. However, I think that particular problem will become smaller in the future as people upgrade their systems. Are you sure you can't upgrade. I thought one could just `apt dist-upgrade`. Maybe it's risky, I don't know. Never had a problem with `apt update && apt upgrade && apt dist-upgrade`.

    Did you download or clone the code from github?
  • edited January 26
    I guess what I'm suggesting is consider putting your Geany command line settings directly into your Makefile and just call make with the standard Geany build commands. As your project grows, it will be easier to manage and you can build your source anywhere make is available. (Everywhere)

    Nm about the upgrade, forgot you have special hardware.
  • edited January 26
    thank you, but as already stated, I never use cmake or makefile by my own - that's why I use Geany finally.
    So again, what's needed is something simple as a "setup.exe" for Windows or just a "apt-get install" for Jessie, which then performs all and everything for installation.
    Anything else is far too cumbersome and too complicated to me.

    I have the Jessie installation by NOOBS, no upgrade to Stretch is possible.
  • I understand what's wanted but at this point you know what I know.
  • edited January 27
    sorry, but I must admit that I didn't understand anything of the things you wrote, and I don't know anything more than before, unfortunately. I simpy want to use raylib, the details about how it is constructed and how it's made by glfw, platform, graphics, dependencies, make, makefile, are far beyond my skills of understanding, and all that actually just confuses me.
  • edited January 28
    Maybe someday a better setup will exist. For now, the makefiles are the simplest solution. Thanks for your feedback. Good luck.
Sign In or Register to comment.