Raspberry pi compiling problem

Hi

I've been trying to compile raylib on the rasberry pi, but I had some problems with the examples

First I used make in the src and that seemed to work without problem
Bash Make src output: http://pastebin.com/MDeSHzAj

I then get an error when I used make in the examples folder
Bash Make examples output: http://pastebin.com/t7neQuBS

I'm not sure where I'm going wrong...

Comments

  • Hi Redgeneral,

    You must compile source and examples using:

    make PLATFORM=PLATFORM_RPI -B

    The last -B just forces the recompilation of all code files, it can be omitted.
  • Everything now compiles - Thank you

    Slight problem - examples accept mouse but not keyboard input - escape key won't close the programs. I then checked the core_input_keys example program and there is no reaction to any key press.

    The raspberry pi is the new Zero version (1ghz, 512Mb ram) using the latest release of raspbian.
  • Hi Redgeneral,

    I haven't tested raylib on the RPI Zero yet. There are some known problems with inputs, but usually related to mouse, not keyboard... More info here: https://github.com/raysan5/raylib/issues/39

    How is your keyboard and mouse connected to the RPI? Have you tried operating through SSH? That way keyboard should work...
  • I have tried my main wireless HP mouse / keyboard in the only usb socket and also in a powered hub. It works in other applications, but not the examples.

    I also tried my Rii Mini K01X1 wireless (mouse and trackpad in one unit) with and without powered hub. Fine in other applications, but not examples.

    Finally I tried a USB converter for PS/2 mouse and keyboard - Pi didn't work with it at all.

    At this point I ran out of keyboards...

    I haven't tried remotely sending input through SSH - it is a little beyond me. My pi and desktop share the same monitor, I can only use one at a time.
  • Hi Redgeneral,

    This Christmas holidays I'll try to review the input system for the RPI. It's not an easy task and it requires some time...
  • For Raspberry Pi, Mouse and GamePad are threads, WindowClose(); will not complete unless a key press. Using the Library in a stand along system will cause the program to hang waiting forever.

    I added to the PLATFORM_RPI

    windowShouldClose = true;

    Now the library can be used as a general purpose graphics library for other applications as the window can be closed by calling WindowClose(); As it should be. Other PLATFORMS probably need the change as well to ensure the program does not hang waiting for an event that will never come.

    Below is the if definition in the waiting for threads to join where I added the affirmative windowShouldClose=true.

    Ray, thank you for such a great and useful library.
    MPurity


    #if defined(PLATFORM_RPI)
    // Wait for mouse and gamepad threads to finish before closing
    // NOTE: Those threads should already have finished at this point
    // because they are controlled by windowShouldClose variable
    windowShouldClose = true; //added to force threads to exit when the close window is called.
    pthread_join(mouseThreadId, NULL);
    pthread_join(gamepadThreadId, NULL);
    #endif
  • Hey MPurity! Thank you very much for pointing this out!

    Already corrected on github develop branch: https://github.com/raysan5/raylib/commit/1142d4edae645f9e5b235c2c3278a8d16a1f97cf

    Thanks! :)
Sign In or Register to comment.