Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble compiling #10

Closed
clehner opened this issue Sep 20, 2013 · 6 comments
Closed

Trouble compiling #10

clehner opened this issue Sep 20, 2013 · 6 comments

Comments

@clehner
Copy link

clehner commented Sep 20, 2013

I am on Debian testing. My build fails and it looks like I have conflicting header files.
What can I do about this?

$ make
make -C pommed OFLIB=
make[1]: Entering directory `/usr/local/src/pommed-light/pommed'
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o evdev.o evdev.c
In file included from /usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
                 from /usr/include/linux/fcntl.h:4,
                 from /usr/include/linux/inotify.h:11,
                 from evdev.c:37:
/usr/include/asm-generic/fcntl.h:171:8: error: redefinition of ‘struct flock’
In file included from /usr/include/fcntl.h:35:0,
                 from evdev.c:25:
/usr/include/x86_64-linux-gnu/bits/fcntl.h:35:8: note: originally defined here
make[1]: *** [evdev.o] Error 1
make[1]: Leaving directory `/usr/local/src/pommed-light/pommed'
make: *** [pommed] Error 2
@bytbox
Copy link
Owner

bytbox commented Sep 20, 2013

Can you try commenting out line 25 of evdev.c, and see if it compiles then?

(While that should/may fix it, this is a packaging bug on Debian's part, I think. See for example https://bugs.launchpad.net/ubuntu/+source/linux/+bug/933045)

@bytbox
Copy link
Owner

bytbox commented Sep 20, 2013

Actually, I think it should also be fixed in my Makefile. Can you give me the output of find /usr/include | grep inotify? Thanks.

@clehner
Copy link
Author

clehner commented Sep 20, 2013

Yes, with line 25 of evdev.c commented out, the build gets past that point. It goes on to have some other errors:

cel@cel:/usr/local/src/pommed-light$ make
make -C pommed OFLIB=
make[1]: Entering directory `/usr/local/src/pommed-light/pommed'
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o evdev.o evdev.c
evdev.c: In function ‘evdev_inotify_process’:
evdev.c:320:7: warning: implicit declaration of function ‘open’ [-Wimplicit-function-declaration]
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o conffile.o conffile.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o audio.o audio.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o evloop.o evloop.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o power.o power.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o beep.o beep.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o video.o video.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o sysfs_backlight.o sysfs_backlight.c
gcc -g -O2 -Wall  -I/usr/include/alsa       -DNO_SYS_INOTIFY_H -DNO_SYS_TIMERFD_H   -c -o mactel/x1600_backlight.o mactel/x1600_backlight.c
mactel/x1600_backlight.c:40:21: fatal error: pci/pci.h: No such file or directory
compilation terminated.
make[1]: *** [mactel/x1600_backlight.o] Error 1
make[1]: Leaving directory `/usr/local/src/pommed-light/pommed'
make: *** [pommed] Error 2

finding inotify.h:

$ find /usr/include | grep inotify
/usr/include/linux/inotify.h
/usr/include/x86_64-linux-gnu/bits/inotify.h
/usr/include/x86_64-linux-gnu/sys/inotify.h

@bytbox
Copy link
Owner

bytbox commented Sep 20, 2013

You need to install pciutils, or pciutils-dev, or whatever the debian package is with /usr/include/pci/pci.h.

Do you know why /usr/include/sys/inotify.h is missing in debian? Is it available in another package, or is makefile/autoconf voodoo the officially supported way to pick the right file?

@clehner
Copy link
Author

clehner commented Sep 20, 2013

Installed libpci-dev and built successfully! Thanks for your help.

I found that /usr/include/sys/inotify.h is provided by libc6-dev-i386. That has a bunch of deps so I am going to leave it uninstalled. I'm not sure what the best way to handle this is.

@bytbox
Copy link
Owner

bytbox commented Sep 20, 2013

That's the 32-bit version of the header. Weird.

I don't have time to look into this tonight, but I still consider it a bug. I'm leaving this issue open until I can test things properly on debian (sometime over the weekend I suspect), and get it to compile without issue.

Thanks for the report.

@bytbox bytbox closed this as completed Sep 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants