Unsure how to set up OSLib
helixnebula77 (13894) 11 posts |
Hi! I found the following video series on youtube: Its from 2016. The video talks about how OSLib can be acquired from the riscos.info repository on !PackMan, but its gone to a 404 =( I see there are still some places to download OSLib (https://ro-oslib.sourceforge.io/) but I don’t know how to install it. What directory should I install that in, so i can #include it in my C code? I am new to C and I was hoping to learn it on RISC OS! |
Paolo Fabio Zaino (28) 1882 posts |
Hi Helixnebula77 and welcome! As for OSLib you can get the sources from here: https://ro-oslib.sourceforge.io/release-7.00.html The link contains also a StrongHelp downloadable guide and some examples. As for riscos.info, unfortunately lately it has been having quite a few issues, sorry about that, hoepfully the mantainers will manage to fix them. As for the installation: - Download and Unzip the edition you need (with edition I mean the build for the specific GCC you are using, they forgot to define a classification name for this, so I use the word “Edition” for it) That should suffice to get you started. Good luck! HTH |
Jean-Michel BRUCK (3009) 362 posts |
Hi For compilation Steve uses DDE (me too) Good learning. |
Steve Fryatt (216) 2105 posts |
For that tutorial, yes… For “real work”, I use the GCCSDK on Linux; if that’s of any interest, there’s some hints on compiling OSLib over there in my guide to setting up my build environment at https://www.stevefryatt.org.uk/risc-os/build-tools/environment |
helixnebula77 (13894) 11 posts |
Thank you Paolo and all for your replies. I am still having trouble. I forgot to mention that i am using GCC from !PackMan instead of the DDE. If my problems are related to not using DDE, I can aquire that. I have extracted OSLib to the path $.Apps.Library.OSLib. I have also tried placing the files directly into $.Apps.Library. I run SetVars after moving the files and before compilation. GCC is saying “fatal error: oslib/wimp.h: No such file or directory” for input command “gcc -o out hello.c” As in the Steve Fryatt turotial, my c file has #include “oslib/wimp.h” at the top. The tutorial doesnt seem to go into any detail about how to get oslib installed properly. |
Steve Fryatt (216) 2105 posts |
It does, on the page following the one that Jean-Michel pointed you to: https://www.stevefryatt.org.uk/risc-os/wimp-prog/compiling-the-application. Under “Installing OSLib” it explains that you’ll need to copy the library folder “somewhere” (as it says, there’s no set way to do it, so put it somewhere near your compiler installation), then make sure that the SetVars file is run before you compile for the first time each session so that some system variables are set up.
With OSLib installed and SetVars run, try something like
That’s off the top of my head, and completely untested (I use GCC on Linux, not RISC OS). If it doesn’t work, you might need to specify Once you get it working, putting the compilation command for a project into an Obey file alongside the source is a Very Good Idea that saves a lot of typing… Or investigate Makefiles… |
helixnebula77 (13894) 11 posts |
Oh I admit i didnt check the third chapter! Thank you for the correction. I read the page, I dont have DDE but the GCC command you gave me in this thread seems to do and say the exact same thing as what is detailed on the page for DDE. I am getting a new error now, I rebooted the machine, ran !GCC and SetVars again, and still I am getting this error. I ran `Show OSLib*` in the task window and it prints OSLib$Dir and OSLib$Path as being the same directory I extracted OSLib to. |
David Pitt (9872) 363 posts |
Here, the OSLib 7.00 library file is As tested here the command line for GCC 4.7.4 Release 6 is of the form :- *gcc -IOSLib: -LOSLib: -lOSlib32 Helloworld.c -o HelloWorld A take 2 with Stephen Fryatt’s Example 2.1 also built :- *gcc -IOSLib: -LOSLib: -lOSlib32 main.c -o main From long ago I do recall being baffled by the ‘not found’ library error. The ‘o’ to ‘a’ change is associated with gcc’s move to ELF technology, IIRC. HTH. |
Steve Fryatt (216) 2105 posts |
That’s the way that libraries tend to be named over on Linux: my OSLib that I use in the GCCSDK Crosscompiler is There’s also an assumption over there that the names start with a silent ‘lib’, because that’s how GCC and its predecessors have always done it. So if you use |
helixnebula77 (13894) 11 posts |
Thanks for all the replies! David Pit: I ran these commands and it still has not been able to find the OSLib library. I ended up buying the DDE, I followed the DDE instructions on Steve Fryatt’s site and got it to work. I’ve now been able to compile an application with OSLib, but never with GCC =( |