编译ushare的时候出现‘struct sockaddr_storage’ has no member named ‘s_addr’

这是使用libupnp1.6.19出现版本号不兼容的错误。

解决方法:libupnp换成1.4.2版本号

配置:

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

$ ./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              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...

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

须要开启DLNA支持的话,使用:

$./configure --enablle-dlna

编译:

$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

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

查看ushare.c文件相应内容:

…/src/ushare.c

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

191 
 ip = request->CtrlPtIPAddr.s_addr;

192   ip = ntohl (ip);

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

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

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

看看struct sockaddr_storage的定义在哪个头文件

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

$ grep -rn"struct sockaddr_storage" /usr/local/include/

/usr/local/include/upnp/upnp.h:632:  struct sockaddr_storage CtrlPtIPAddr;

/usr/local/include/upnp/upnp.h:679:  struct sockaddr_storage CtrlPtIPAddr;

/usr/local/include/upnp/upnp.h:759:     struct sockaddr_storage DestAddr;

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

这里看到的都不是它的定义

找了非常久还是没有发现它的定义,FQgoogle一下:

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

还有这个:

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

还是乖乖把libupnp换成1.4.2版本号吧。。。

ushare编译之 ‘struct sockaddr_storage’ has no member named ‘s_addr’的更多相关文章

  1. 【Linux】解决"no member named 'max_align_t'

    编译遇到错误: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef:51:11: erro ...

  2. 安装Stomp扩展时错误提示error: 'zend_class_entry' has no member named 'default_properties'

    在安装stomp扩展时, 有这样的提示 error: 'zend_class_entry' has no member named 'default_properties' 交待下安装上下文, sto ...

  3. 错误:'class QApplication' has no member named 'setMainwidget'

    错误:'class QApplication' has no member named 'setMainwidget' 转自:http://blog.csdn.net/chenqiai0/articl ...

  4. NDK 编译报错:request for member 'FindClass' in something not a structure or union

    ndk编译 xx.c文件时一直报下面的错误: ”request for member 'FindClass' in something not a structure or union ...” 原因 ...

  5. Spark wordcount 编译错误 -- reduceByKey is not a member of RDD

    Attempting to run http://spark.apache.org/docs/latest/quick-start.html#a-standalone-app-in-scala fro ...

  6. Solve error: 'class vtkImageActor' has no member named 'SetInput'

    Replacement of SetInput() with SetInputData() and SetInputConnection() someFilter->SetInput(someR ...

  7. class Qstring has no member named to Ascii

    人家修改了.真的没有toAscii了.不过可以用toLatin1或者qPrintable()

  8. No member named 'setResizeMode' in 'QHeaderView' - Convert Qt 4.7 to Qt 5.8

    https://stackoverflow.com/questions/42743141/no-member-named-setresizemode-in-qheaderview-convert-qt ...

  9. Ubuntu 编译安装 Linux 4.0.5 内核,并修复 vmware 网络内核模块编译错误

    . . . . . 今天把 Ubuntu 14.04 升级到了最新的 4.0.5 的内核版本,本来不打算记录下来的,但是升级的过程中确实遇到了一些问题,所以还是记录下来,分享给遇到同样问题的猿友. 先 ...

随机推荐

  1. XVIII Open Cup named after E.V. Pankratiev. Grand Prix of Khamovniki Problem J Stairways解题报告(分块+维护凸壳)

    首先ORZ一发Claris聚聚的题解:http://www.cnblogs.com/clrs97/p/8689215.html,不然我可能没机会补过这道神题了. 这里写一个更详细的题解吧(我还是太菜了 ...

  2. Manthan, Codefest 16 B 数学

    B. A Trivial Problem time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  3. python中文注释报错

    # -*- coding: utf-8 -*-#coding=utf-8 在开头加这个

  4. react当中两种获取表单数据的方法

    方法一: 获取dom当中的数据 需要操作的dom上面有  ref="test", 当需要获取的时候  this.refs.test.value  就可以获取当前输入框的value值 ...

  5. linux之stat

    stat指令:文件/文件系统的详细信息显示: 使用格式:stat 文件名 stat命令主要用于显示文件或文件系统的详细信息,该命令的语法格式如下: -f 不显示文件本身的信息,显示文件所在文件系统的信 ...

  6. 【Visual Studio】以管理员的身份运行软件

  7. css命名推荐

    CSS命名推荐规范:个人收藏 方便查阅 页面结构: 容器: container/wrap 整体宽度:wrapper 页头:header 内容:content 页面主体:main 页尾:footer 导 ...

  8. Python学习杂记_8_从程序外部传参的办法sys.argv

    Python用 sys.argv[] 实现从程序外部传参 “外部”的含义,其实就是这些参数不是你在程序中定义的,而是在程序之外通过输入操作传递进来的.sys.argv 会返回一个元组,元组的首个元素即 ...

  9. 定时执行rsync同步数据以及mysql备份

    需求:把机器A中的附件.图片等,备份到备份机B中.将数据库进行备份 附件备份 在A中,启动rsync服务,编辑/etc/xinetd.d/rsync文件,将其中的disable=yes改为disabl ...

  10. 【转载】Word2010编号列表&多级列表

    1.引用场景         对于一份标准.漂亮的word文档,编号列表和多级列表的设置时必不可少的,正因为有它们,文档看起来才更专业,使用起来才更加的方便.如下面截图一般,这是十分常见的多级列表设置 ...