conflicting types for ‘timer_t’ 的解決

來源:互聯網
上載者:User
編譯器時遇到conflicting types for 'timer_t'  問題的的解決Slackware 12.1-Xfce 4.4.2下安裝電池監視器外掛程式編譯出錯的解決方案

http://goodies.xfce.org/提供了許多Xfce環境下的外掛程式,其中有個電池監視器外掛程式,按照安裝說明中的步驟編譯時間出現如下錯誤:

In file included from ./libapm.h:21,
                 from battery.c:39:
/usr/include/sys/types.h:62: error: conflicting types for 'dev_t'
/usr/include/linux/types.h:19: 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:53: 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:21: 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:22: 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:52: error: previous declaration of 'uid_t' was here
In file included from /usr/include/sys/types.h:133,
                 from ./libapm.h:21,
                 from battery.c:39:
/usr/include/time.h:105: error: conflicting types for 'timer_t'
/usr/include/linux/types.h:28: error: previous declaration of 'timer_t' was here
In file included from /usr/include/sys/types.h:220,
                 from ./libapm.h:21,
                 from battery.c:39:
/usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
/usr/include/linux/types.h:18: error: previous declaration of 'fd_set' was here
In file included from ./libapm.h:21,
                 from battery.c:39:
/usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
/usr/include/linux/types.h:151: error: previous declaration of 'blkcnt_t' was here
make[2]: *** [xfce4_battery_plugin-battery.o] Error 1
make[2]: Leaving directory `/tmp/xfce4-battery-plugin-0.5.1/panel-plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/xfce4-battery-plugin-0.5.1'

make: *** [all] Error 2

 

解決方案:

開啟panel-plugin/libapm.h

將如下兩行的位置互換

#include <linux/apm_bios.h>

#include <sys/types.h>

變成

#include <sys/types.h>

#include <linux/apm_bios.h>

 

重新編譯,通過!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.