Cannot load onto Raspberry Pi3

Hi

I really love the capabilities of your RAYLIB library but I just cannot get it to compile and build on my Raspberry pi3

I am using GEANY and 'C' and have lots of other programs and libraries that work fine. One is the BCM2835.h library.
I loaded the BCM2835.h library following detailed download instructions on their webpage ... and it all magically loaded and works.

I've followed your GITHUB Raylib compile instructions for the Pi and got Raylib into raylib/src directory. I've ran make PLATFORM=PLATFORM_RPI and it displayed a single line list of modules. ( cannot tell if it actually did anything or not.. it did not display any compiled ok messages and took no time at all )

I've included the gcc -lraylib in the compile and build setups etc. and created a simple C program that just states '#include ' and a simple printf line in main.

It fails at compile and cannot find raylib. I've tried adding -I and -I ( little L and big i ) in the Geany include paths etc... and got it to compile in the end.. but build then still says it cannot find -lraylib

"usr/bin/ld: cannot find -lraylib"


I have spend 2 days searching Google for solutions to this last step and do not want to have to abandon your Raylib library as it does exactly what I need and must be ideal for Raspberry Pi users everywhere !

It would really be good for your visibility and for Raylib itself if you could provide detailed download and setup instructions for installing RAYLIB on a Pi(3) and make these instructions detailed for an absolute beginner please. your existing ones are sketchy and are difficult to understand for a beginner.

For instance is there a Sudo install package available ?? You say just download and run instructions but I am fresh to Raspian and find the terminal navigation lines etc very odd and hard to learn. ( I'm an old MSDOS guy )

Comments

  • Update... Re ran the 'make PLATFORM=PLATFORM_RPI' adding ' -B' to the end and that forced a rebuild of all modules.. Lots of lines scrolled up screen and all seemed to look good. So I believe the RAYLIB platform is set to Pi OK now.

    However, still not able to build successfully ..

    Regards

    Dave
  • Got to compile by adding '-I/home/pi/raylib/src -l raylib' into Geny gcc compile line ( The -I/home... is a capital i and the -l raylib.. bit is a lowercase L ) -- These look the same on my window !! -- But putting similar into the build line still returns
    'usr/bin/ld: cannot find -lraylib'
    ld returned 1 exit status

    Regards

    Dave
  • Is there supposed to be a "Raylib.o" object file somewhere ???
  • Hello Dave!

    After compiling the library you should get libraylib.a, that's the library to link with your program.

    I read you are using GEANY, that's ok but keep in mind that raylib and examples are prepared by default to run directly in a native screen (directly from terminal), I mean, not inside a window in desktop mode... It's also possible but right now it's not configured to work that way.

    It seems that your problem is related to include/library paths configuration on GEANY. Have you tried following this steps (https://github.com/raysan5/raylib/wiki/Compile-for-Raspberry-Pi) from command line (terminal)? It should work...

    Another point is that I just tested everything in Raspberry Pi 1 and 2, I imagine there shouldn't be any problem with 3 but it's not tested.

    It would be very useful if you try to share some compiling output log (what appears on the terminal when you try to compile the library and your project), that way I could better track your issue.

    About GCC compiling parameters: You can define the path to look for includes (.h files) and the path to look for libraries (.a files). It is done using -I and -L.
    Example: gcc mygame.c -o mygame -L. -L..\my_path -I. -I.. -I..\my_path

    Please, keep me updated with your advances! :)



  • About the updated instructions and intall packages for Linux/Raspbian, it's on my TO DO list... The problem is that my list is too long... :P
  • No problem :) --

    Your problem is not that your list is too long.. It's more that a day is too short !!!! :) !!

    I'm now managing to build and run OK using your great instructions !! The secret bit seems to have been the new info regarding using 'libraylib' - I would never have guessed to add that :) ... I'm going to next add in some screen drawing Raylib functionality and will get back to you on progress etc.

    Once I'm all working and progressing I'll produce a simple, detailed guide for loading GEANY and RAYLIB onto Pi3 and get it to you to review and use if it is useful to you.

    Many thanks and best wishes

    Dave
  • Sounds great to me Dave! Please, keep me updated! :smiley:
  • Ray,

    I was also getting this error when I followed your Raspberry Pi build instructions, following a git clone of the github repository on a new install of Raspbian Jessie.

    'usr/bin/ld: cannot find -lraylib'

    Looking at the gcc command line, it looks like it is expecting to find the raylib library in ../src but when compiled it is created in ../release/rpi/libraylib.a

    I copied it into ../src and it then compiled fine.

    Also, earlier in the process, when compiling the library for a RPi, it failed because it wasn't able to create ../release/rpi/libraylib.a this was just due to there being no ../release/rpi directory - I created it, and the library built fine.

    Two very minor issues, but might trip an inexperienced user up.

    Morph
  • Hi Morph!

    Thank you very much for pointing this issue!

    Actually, I already corrected it in raylib develop branch but it hasn't been merged into master yet... I keep working on that branch and I was waiting to fix a couple more issues...

    Usually, develop branch is stable so I'll try to do the merge as soon as possible.
Sign In or Register to comment.