undefined reference to `shm_open'

Carmelo AMOROSO carmelo.amoroso at st.com
Wed Dec 16 07:07:30 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Niko Lau wrote:
> 2009/12/15 Ian Harrold <ian.harrold at gmail.com>:
>>
>> On Tue, Dec 15, 2009 at 10:31 AM, Niko Lau <niko84embedded at googlemail.com>
>> wrote:
>>> 2009/12/15 Lennart Sorensen <lsorense at csclub.uwaterloo.ca>:
>>>> On Tue, Dec 15, 2009 at 05:16:05PM +0100, Niko Lau wrote:
>>>>> I want to use the libv4l2 for my arm platform with uclibc cross
>>>>> compiler.
>>>>> When I link a appl with that lib I get the following error:
>>>>> arm-linux-uclibc-gcc -Wall -O2 -g -I../libv4l2/include
>>>>> -L../libv4l2/lib  -o capture capture.c -lv4l2 -lv4lconvert
>>>>> ../libv4l2/lib/libv4lconvert.so: undefined reference to `shm_open'
>>>>> collect2: ld returned 1 exit status
>>>>> make: *** [test] Fehler 1
>>>>>
>>>>> The lib is built with the same compiler without any error.
>>>>> Can someone give me a hint what the problem is. Since it works with a
>>>>> glibc compiler i think the problem is the uclibc.
>>>> The man page (for the glibc version) says you have to link with -lrt.
>>>> I don't see you doing that.  Do you have to?  Does uclibc have such
>>>> a thing and does it do shm_open?  I guess it must or the header files
>>>> would have failed yoiur earlier compile already.
>>>>
>>>> --
>>>> Len Sorensen
>>>>
>>> The -lrt flag is set during libv4lconvert building. I can see shm_open
>>> in the include file (/sys/mman.h)
>>> so i think uclibc has shm_open.
>>>
>>> Niko
>>
>> Did you compile uclibc with "UCLIBC_HAS_REALTIME" option for real time
>> support?  I beleive this to be correct.
>>
>> shm_open() implementation is in /librt/shm.c  and defined in
>> /include/sys/shm.h
>>
>> So if your code capture.c uses shm, then you need to link the implementation
>> -lrt in the compile to fix the linker error.   If that still doesn't work
>> then perhaps you didn't compile uclibc to support shm?
> 
> Ok it looks like shm is not fully implemented yet.

Hi,
that's wrong, shm support is now fully available on master branch
> 
> -lrt in compile line doesnt work. UCLIBC_HAS_REALTIME is on, but there
> is no /librt/shm.c.

where are you looking for ?

> 
> Thanks for the help.
> Niko
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAksohzIACgkQoRq/3BrK1s9/pwCgqWP/l3W1FyIChjof2+8B/NJA
xkEAn27jPAmvjlIm7bXM2Dzal0UNjUKz
=KGy+
-----END PGP SIGNATURE-----


More information about the uClibc mailing list