LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   sys/types.h & linux/types.h conflict while compiling (http://www.linuxquestions.org/questions/linux-software-2/sys-types-h-and-linux-types-h-conflict-while-compiling-693472/)

johnnyhal 12-28-2008 12:06 PM

sys/types.h & linux/types.h conflict while compiling
 
Hi,

I'm having trouble solving this problem. I'm compiling xfce4-battery-plugin and I keep getting an error about conflicting types in sys/types.h and linux/types.h while making battmon.c. The output is:

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -I/usr/include/xfce4/ -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0 -g -O2 -MT xfce4_battery_plugin-battmon.o -MD -MP -MF ".deps/xfce4_battery_plugin-battmon.Tpo" -c -o xfce4_battery_plugin-battmon.o `test -f 'battmon.c' || echo './'`battmon.c; \
then mv -f ".deps/xfce4_battery_plugin-battmon.Tpo" ".deps/xfce4_battery_plugin-battmon.Po"; else rm -f ".deps/xfce4_battery_plugin-battmon.Tpo"; exit 1; fi
In file included from ./apm.h:24,
from battmon.c:44:
/usr/include/sys/types.h:62: error: conflicting types for 'dev_t'
/usr/include/linux/types.h:13: error: previous declaration of 'dev_t' was here
/usr/include/sys/types.h:67: error: conflicting types for 'gid_t'
/usr/include/linux/types.h:27: error: previous declaration of 'gid_t' was here
/usr/include/sys/types.h:72: error: conflicting types for 'mode_t'
/usr/include/linux/types.h:15: error: previous declaration of 'mode_t' was here
/usr/include/sys/types.h:77: error: conflicting types for 'nlink_t'
/usr/include/linux/types.h:16: error: previous declaration of 'nlink_t' was here
/usr/include/sys/types.h:82: error: conflicting types for 'uid_t'
/usr/include/linux/types.h:26: error: previous declaration of 'uid_t' was here
In file included from /usr/include/sys/types.h:133,
from ./apm.h:24,
from battmon.c:44:
/usr/include/time.h:105: error: conflicting types for 'timer_t'
/usr/include/linux/types.h:22: error: previous declaration of 'timer_t' was here
In file included from /usr/include/sys/types.h:220,
from ./apm.h:24,
from battmon.c:44:
/usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
/usr/include/linux/types.h:12: error: previous declaration of 'fd_set' was here
In file included from ./apm.h:24,
from battmon.c:44:
/usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
/usr/include/linux/types.h:124: error: previous declaration of 'blkcnt_t' was here
make[2]: *** [xfce4_battery_plugin-battmon.o] Error 1
make[2]: Leaving directory `/root/Desktop/xfce4-battery-plugin-0.4.90.2/panel-plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Desktop/xfce4-battery-plugin-0.4.90.2'
make: *** [all] Error 2

Anyone know what's causing this?

Thanks,
Johnny

knudfl 12-28-2008 06:39 PM

Welcome to Linux Questions.

A usable version is here
http://packages.debian.org/lenny/xfce4-battery-plugin
[xfce4-battery-plugin_0.5.0.orig.tar.gz]
[xfce4-battery-plugin_0.5.0-7.diff.gz] The patch is important !

1) place the patch outside xfce4-battery-plugin-0.5.0 and
'patch -p0 < xfce4-battery-plugin_0.5.0-7.diff'

2) go to the "patch directory" xfce4-battery-plugin-0.5.0/debian/patches/
and move all patches outside xfce4-battery-plugin-0.5.0

3) apply patches 02 05 06 07 08. Patch 07 must be edited :

line 1, 2, 345, 346 change xfce4-battery-plugin-0.5.0.orig
to xfce4-battery-plugin-0.5.0

4) move patch 03 inside the xfce4-battery-plugin-0.5.0/ and
apply it there.

Now you can configure and make.
If you have questions, always tell, which Linux is used.
http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html

Good Luck !
....


All times are GMT -5. The time now is 02:02 AM.