nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Using DeskLib with gcc

Thu Nov 15, 2012 9:28 am

Hi all, sorry, it's another gcc question, which has me going round in circles. I've been trying to use DeskLib for a few days now, with no success whatsoever. I noticed this morning that the DeskLib packages had appeared in !PackMan, so I tried a re-install, and also installed the examples, so I could try and get a clean compile of something to see where I was going wrong. However, I'm still getting the same problem:

Code: Select all

*ex
Dir. SDFS::RISCOSpi.$.Apps.Library.DeskLib.Examples.!FontDemo Option 02 (Run) 
CSD  SDFS::RISCOSpi.$.Apps.Library.DeskLib.Examples.!FontDemo
Lib. SDFS:"Unset"
URD  SDFS:"Unset"
!Boot        WR/WR   Obey      16:06:27 30-Jul-2006   50  bytes
!Run         WR/WR   Obey      16:06:27 30-Jul-2006   86  bytes
c            D/      Directory 08:57:35 15-Nov-2012 2048  bytes
h            D/      Directory 08:57:35 15-Nov-2012 2048  bytes
Makefile     WR/WR   Text      16:06:27 30-Jul-2006  203  bytes
Messages     WR/WR   Text      16:06:27 30-Jul-2006  248  bytes
Templates    WR/WR   Template  16:06:27 30-Jul-2006  132  bytes

*make COMPILER=gcc
gcc -O2 -mthrowback   -c -o main.o main.c
gcc -o !runimage main.o Desklib:Desklib.o -O2 -mthrowback
/Desklib:Desklib.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [!runimage] Error 1

I'm stumped by this - I've run the !RunImage file in the !DeskLib app to set the necessary paths. I'm using the version of make installed from !PackMan, and gcc from http://www.riscos.info/downloads/gccsdk/latest/

Code: Select all

*show desklib*
DeskLib$Dir : SDFS::RISCOSpi.$.Apps.Library.DeskLib.!DeskLib
DeskLib$Path : DeskLib_User:,DeskLib_Core:
DeskLib_Core$Path : SDFS::RISCOSpi.$.Apps.Library.DeskLib.!DeskLib.,SDFS::RISCOSpi.$.Apps.Library.DeskLib.!DeskLib.include.,
Am I missing something obvious? Do I have the correct version of gcc? Or am I missing a dependency somewhere? Any ideas anyone?

Code: Select all

*gcc -v
Using built-in specs.
Target: arm-unknown-riscos
Configured with: /home/joty/projects/gccsdk/gccsdk_svn1/gcc4/srcdir/gcc/configure --host=arm-unknown-riscos --target=arm-unknown-riscos --prefix=/home/joty/projects/gccsdk/gccsdk_svn1/gcc4/release-area/full/!GCC --enable-threads=posix --enable-sjlj-exceptions=no --enable-c99 --enable-cmath --enable-multilib --enable-shared=libunixlib,libgcc,libstdc++ --disable-c-mbchar --disable-wchar_t --disable-libstdcxx-pch --disable-tls --with-cross-host --with-pkgversion=GCCSDK GCC 4.1.2 Release 1 Development --with-bugurl=http://gccsdk.riscos.info/ --enable-maintainer-mode --enable-interwork --disable-nls --enable-checking=no --enable-languages=c,c++
Thread model: posix
gcc version 4.1.2 (GCCSDK GCC 4.1.2 Release 2)
Thanks,
--
nr.

grannyg
Posts: 22
Joined: Fri Nov 02, 2012 11:55 am

Re: Using DeskLib with gcc

Thu Nov 15, 2012 1:38 pm

nr. wrote: Am I missing something obvious? Do I have the correct version of gcc? Or am I missing a dependency somewhere? Any ideas anyone?

Code: Select all

*gcc -v
Using built-in specs.
Target: arm-unknown-riscos
Configured with: /home/joty/projects/gccsdk/gccsdk_svn1/gcc4/srcdir/gcc/configure --host=arm-unknown-riscos --target=arm-unknown-riscos --prefix=/home/joty/projects/gccsdk/gccsdk_svn1/gcc4/release-area/full/!GCC --enable-threads=posix --enable-sjlj-exceptions=no --enable-c99 --enable-cmath --enable-multilib --enable-shared=libunixlib,libgcc,libstdc++ --disable-c-mbchar --disable-wchar_t --disable-libstdcxx-pch --disable-tls --with-cross-host --with-pkgversion=GCCSDK GCC 4.1.2 Release 1 Development --with-bugurl=http://gccsdk.riscos.info/ --enable-maintainer-mode --enable-interwork --disable-nls --enable-checking=no --enable-languages=c,c++
Thread model: posix
gcc version 4.1.2 (GCCSDK GCC 4.1.2 Release 2)
Thanks,
I believe that version of DeskLib can only be used with the older gcc 3.x. gcc 4.1 only supports libraries in ELF format. There is a newer version of DeskLib but it's not available for download anywhere. Hopefully in the next few days it should appear in !Packman.

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Using DeskLib with gcc

Thu Nov 15, 2012 1:50 pm

Cool, many thanks for that confirming that. The !PackMan version is 2.80, and from reading around a bit yesterday I saw some references to a 3.00 version for later versions of gcc. I just couldn't find it anywhere! I'll wait a while before checking out for new versions.

Ta,
--
nr.

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Using DeskLib with gcc

Tue Nov 27, 2012 6:26 pm

mmm, I've done a bit more looking around, and looking at http://www.riscos.info/index.php/DeskLib I see the following:

Current Release
The current version is 3.00, and is ELF-only for use with latest versions of GCC
* Coming Soon

which is all very encouraging, until I get to the bottom of the page and see "This page was last modified on 13 December 2009". A bit more digging then found http://comp.sys.acorn.programmer.narkiv ... sklib-3-00 and "I'm afraid I've stopped working on DeskLib (much as I'd like to) as I no longer have time for RISC OS programming stuff."

Does anyone know if v3.00 is still being worked on anywhere else by anyone? I'd offer to have a look myself, but I'm not much of a programmer. Still, never too late to learn, if that's the only option :)

Ta,
--
nr.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Using DeskLib with gcc

Sun Jan 06, 2013 6:43 pm

Personally I think it would be better to build a more recent GCC that produces AIF and AOF binary images. This would give us back support for things like the current desklib.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Return to “RISCOS”