undefined reference to `shm_open'

Niko Lau niko84embedded at googlemail.com
Tue Dec 15 16:31:01 UTC 2009


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


More information about the uClibc mailing list