Ushare Compilation: 'struct sockaddr_storage 'has no member named's _ ADDR'

Source: Internet
Author: User

'Struct sockaddr_storage 'has no member named's _ ADDR' appears during ushare compilation'

This error occurs when libupnp1.6.19 is used.

Solution: Change libupnp to version 1.4.2.


Configuration:

Bytes ----------------------------------------------------------------------------------------------------

$./Configure

Checking forcompiler available...

Checking for locales...

Checking for ifaddrs...

Checking forlanginfo...

Checking for iconv...

Checking for libixml...

Checking forlibthreadutil...

Checkingfor libupnp> = 1.4.2...

 

Ushare: Configure isok

Version 1.1a

Using libupnp 1.6.19

Configuration:

Install prefix/usr/local

Configuration dir $ {prefix}/etc

Locales dir $ {prefix}/share/locale

NLS support Yes

Dlna support no

C compiler gcc

Strip

Make make

CPU x86 ()

Debug symbols no

Strip symbols Yes

Optimize Yes

 

Cflags-I ..-w-wall-D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS = 64-d_reentrant-d_gnu_source-O3-DHAVE_LOCALE_H-DHAVE_SETLOCALE-dhave_ifaddrs_h-dhave_langinfo_h-DHAVE_LANGINFO_CODESET-DHAVE_ICONV-pthread-I/usr/local/include/UPnP

Ldflags

Extralibs-lixml-lthreadutil-lpthread-lupnp-pthread-L/usr/local/lib

 

Creating config. Mak...

Creating config. H...

Bytes -------------------------------------------------------------------------------------------------


To enable dlna support, use:

$./Configure -- enablle-dlna

 

Compile:

$ Make

----------------------------------------------------------------------------

...

Ushare. C: infunction 'handle _ action_request ':

Ushare. C: 191: 29: Error: 'struct sockaddr_storage 'has no member named's _ ADDR'

Make [1]: *** [ushare. O] Error 1

Make [1]: leavingdirectory '/home/won/downloads/ushare-1.1a/src'

Make: *** [all] Error 2

---------------------------------------------------------------------------

 

View the content of the ushare. c file:

... /Src/ushare. c

Bytes -----------------------------------------------------------------------------------------------------------------------

191 IP = request-> ctrlptipaddr. s_addr;

192 IP = ntohl (IP );

193 sprintf (Val, "% d. % d ",

194 (ip> 24) & 0xff, (ip> 16) & 0xff, (ip> 8) & 0xff, IP & 0xff );

Bytes -----------------------------------------------------------------------------------------------------------------------

 


Check the header file that struct sockaddr_storage defines.

-------------------------------------------------------------------------

$ Grep-RN "struct sockaddr_storage"/usr/local/include/

/Usr/local/include/UPnP. h: 632: struct sockaddr_storage ctrlptipaddr;

/Usr/local/include/UPnP. h: 679: struct sockaddr_storage ctrlptipaddr;

/Usr/local/include/UPnP. h: 759: struct sockaddr_storage destaddr;

-------------------------------------------------------------------------

What we see here is not its definition.

 

After searching for a long time, I still haven't found its definition. Go over the wall and Google it:

 

Http://askubuntu.com/questions/224154/help-with-error-struct-sockaddr-storage-has-no-member-named-s-addr

 

 

 

Also:

Http://ubuntu.aspcode.net/view/635400140124705175347694/help-with-error-struct-sockaddrstorage-has-no-member-named-saddr


Change libupnp to version 1.4.2...

 

Ushare Compilation: 'struct sockaddr_storage 'has no member named's _ ADDR'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.