[gccsdk] Creating shared libraries
alan_baa at hotmail.com
Mon Dec 1 04:49:30 PST 2008
> On Sat, 29 Nov 2008 17:46:24 Lee Noar wrote:
> alan buckley wrote:
>> I don't seem to be able to create shared libraries
>> on RISC OS.
>> I found a simple example on the web and tried the
>> following to build it in an Obey file:
>> gcc -fPIC -Wall -g -c libhello.c
>> gcc -shared -Wl,-soname,libhello.so.0 -olibhello/so/0/0 libhello.o
>> The Result I got was:
>> /ADFS::HardDisc4.$/Apps/Development/!GCC/bin/ld: cannot open output file libhello/so/0/0: Can't open 'libhello.so.0.0'
>> collect2: ld returned 1 exit status
>> I also tried -olibhello.so.0.0 and that also did not work.
>> Can anyone suggest what I might be doing wrong?
> You're not doing anything wrong, as such, it's just unfortunate that
> riscosify() doesn't handle library filenames very well, perhaps because
> it has what might be seen as multiple suffixes. The easiest way around
> it is to use:
> -o /libhello.so.0.0
> The leading backslash forces riscosify() to assume a unix filename.
Thanks Lee this seemed to get it working. It did lead to the problem
with the library being created in the root rather than the development
directory but I got round that by using @/libhello.so.0.0.
Are you a PC? Upload your PC story and show the world
More information about the gcc