OpenWrt Forum Archive

Topic: OpenWRT BB: kernel header and library header conflict

The content of this topic has been archived on 16 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying to build package/app/utility which has to use kernel header (for gpio ) and library headers.




openwrt/build_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/linux-ramips_mt7621/linux-3.10.14/arch/mips/include/asm/socket.h:30:2: error: redeclaration of enumerator 'SOCK_DGRAM'
  SOCK_DGRAM = 1,
  ^
/hopenwrt/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include/bits/socket.h:44:3: note: previous definition of 'SOCK_DGRAM' was here
   SOCK_DGRAM = 1,  /* Connectionless, unreliable datagrams
   ^
/openwrt/build_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/linux-ramips_mt7621/linux-3.10.14/arch/mips/include/asm/socket.h:31:2: error: redeclaration of enumerator 'SOCK_STREAM'
  SOCK_STREAM = 2,
  ^
/openwrt/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include/bits/socket.h:47:3: note: previous definition of 'SOCK_STREAM' was here
   SOCK_STREAM = 2,  /* Sequenced, reliable, connection-based
   ^
/openwrt/build_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/linux-ramips_mt7621/linux-3.10.14/arch/mips/include/asm/socket.h:32:2: error: redeclaration of enumerator 'SOCK_RAW'
  SOCK_RAW = 3,
  ^
/openwrt/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include/bits/socket.h:50:3: note: previous definition of 'SOCK_RAW' was here
   SOCK_RAW = 3,   /* Raw protocol interface.  */
   ^
/openwrt/build_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/linux-ramips_mt7621/linux-3.10.14/arch/mips/include/asm/socket.h:33:2: error: redeclaration of enumerator 'SOCK_RDM'
  SOCK_RDM = 4,

While compiling i get above conflict error , how can it be fixed ?

(Last edited by geek007 on 9 Feb 2018, 07:30)

Your build environment is referring to both the (wrong) include files in your toolchain's staging directory and to the (right) include files under your target directory.

The reason why this happens is unclear from your post, though. If you have attempted the ordinary "make distclean" etc. solutions, then perhaps the GNU make makefile that you use to build your application, or the OWRT package's "makefile" may yield some clues as to why this is happening? Have you checked the include directories?

The discussion might have continued from here.