Page 1 of 1

Using DeskLib with gcc

Posted: Thu Nov 15, 2012 9:28 am
by nr.
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,

Re: Using DeskLib with gcc

Posted: Thu Nov 15, 2012 1:38 pm
by grannyg
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.

Re: Using DeskLib with gcc

Posted: Thu Nov 15, 2012 1:50 pm
by nr.
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,

Re: Using DeskLib with gcc

Posted: Tue Nov 27, 2012 6:26 pm
by nr.
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,

Re: Using DeskLib with gcc

Posted: Sun Jan 06, 2013 6:43 pm
by DavidS
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.