libudev.h: No such file or directory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

libudev.h: No such file or directory

6,811 Views
srinivasanshanm
Contributor III

Dear I.MX Community,

 

I need to monitor USB-stick insertion in my attached c application using libudev & am using L2.6.35_10.12.01_ER_source for I.MX28

I am able to compile using gcc on ubuntu10.04 and it is "OK" but I cannot cross compile using  /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/arm-fsl-linux-gnueabi toolchain & facing the issue as shown below, could anybody please kindly do the needful in resolving the below issue as soon as possible


appusony@appusony-laptop:~/Desktop$ arm-none-linux-gnueabi-gcc libudev-test.c -o libudev-test -ludev

libudev-test.c:25:21: error: libudev.h: No such file or directory

libudev-test.c: In function 'main':

libudev-test.c:42: warning: assignment makes pointer from integer without a cast

libudev-test.c:65: warning: assignment makes pointer from integer without a cast

libudev-test.c:66: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_monitor *'

libudev-test.c:78: warning: assignment makes pointer from integer without a cast

libudev-test.c:79: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_enumerate *'

libudev-test.c:82: warning: assignment makes pointer from integer without a cast

libudev-test.c:83: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_list_entry *'

libudev-test.c:89: error: expected ';' before '{' token

libudev-test.c:174: warning: assignment makes pointer from integer without a cast

libudev-test.c:177: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:178: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:179: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:181: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

appusony@appusony-laptop:~/Desktop$

 

Kindly do the needful

Many Thanks in advance,

Original Attachment has been moved to: libudev-test.c.zip

Labels (2)
0 Kudos
4 Replies

2,275 Views
srinivasanshanm
Contributor III

Could anybody please address this thread as am stuck with this issue from long time

Thanks in advance again!

0 Kudos

2,275 Views
LeonardoSandova
Specialist I

Sri, can you do the same compilation under LTIB's shell?

0 Kudos

2,275 Views
srinivasanshanm
Contributor III

Hi Leo,

Thanks a lot for your quick response, but this did not work, could you please kindly let me know if any other alternate solutions fro this issue

user@user-desktop:~/ltib_evk/ltib$ ./ltib -m shell

Entering ltib shell mode, type 'exit' to quit

LTIB> ls

COPYING RELEASE_INFO config doc host_config.log ltib rootfs rootfs_image tmp

README bin dist hash libudev-test.c ltib_bashrc rootfs.jffs2 rpm

LTIB>

LTIB>

LTIB>

LTIB> arm-none-linux-gnueabi-gcc libudev-test.c -o libudev-test -ludev

libudev-test.c:25:21: error: libudev.h: No such file or directory

libudev-test.c: In function 'main':

libudev-test.c:42: warning: assignment makes pointer from integer without a cast

libudev-test.c:65: warning: assignment makes pointer from integer without a cast

libudev-test.c:66: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_monitor *'

libudev-test.c:78: warning: assignment makes pointer from integer without a cast

libudev-test.c:79: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_enumerate *'

libudev-test.c:82: warning: assignment makes pointer from integer without a cast

libudev-test.c:83: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct udev_list_entry *'

libudev-test.c:89: error: expected ';' before '{' token

libudev-test.c:174: warning: assignment makes pointer from integer without a cast

libudev-test.c:177: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:178: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:179: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

libudev-test.c:181: warning: format '%s' expects type 'char *', but argument 2 has type 'int'

LTIB>

Many Thanks in advance again!

0 Kudos

2,275 Views
LeonardoSandova
Specialist I

Hi,

what you need is to install  libudev-dev on your rootfs. Unfortunately, neither LTIB not Yocto has a recipe ready to be used to install the headers. The correct approach would be to create the .spec/.bb metadata for these building systems. Another approach, would be to install the package on your host, then move the files to rootfs. This latter approach is not good, but lets you move on.

0 Kudos