编译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. Codeforces #1063C Dwarves, Hats and Extrasensory Abilities

    题目大意 交互题. 输出平面上的一个点的坐标,交互程序给这个点染色(白或黑). 如此重复 $n$ 次($ 1\le n \le 30$). 要求输出的 $n$ 个点各不相同,并且不论交互程序怎样给它们 ...

  2. Python爬虫教程-21-xpath

    本篇简单介绍 xpath 在python爬虫方面的使用,想要具体学习 xpath 可以到 w3school 查看 xpath 文档 Python爬虫教程-21-xpath 什么是 XPath? XPa ...

  3. 深入比较选择 Angular 还是 React

    我应该选择 Angular 还是 React?现在JS框架两强的格局让许多开发者选择起来很纠结.无论你是一个正在思考如何入门的新手,还是一个为下个项目挑选框架的设计者,或是一个架构师为公司做长远的规划 ...

  4. 【UVA11859】Division Game(SG函数,Nim游戏)

    题意:给定一个n*m的矩阵,两个游戏者轮流操作. 每次可以选一行中的1个或多个大于1的整数,把它们中的每个数都变成它的某个真因子,不能操作的输. 问先手能否获胜 n,m<=50,2<=a[ ...

  5. 给gridview增加行链接,点击行任意位置进行跳转

    原文发布时间为:2009-04-14 -- 来源于本人的百度文章 [由搬家工具导入] 可这样,在GridView的RowDataBound输入代码,假如id在第0列,且不是摸板列: C# code p ...

  6. 《Linux命令行与shell脚本编程大全 第3版》Linux命令行---46

    以下为阅读<Linux命令行与shell脚本编程大全 第3版>的读书笔记,为了方便记录,特地与书的内容保持同步,特意做成一节一次随笔,特记录如下:

  7. eWebEditor不支持IE7以上版本Bug修改

    修改: \Include\Editor.js //把此行 if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous() ...

  8. hdu 1576(逆元)

    A/B Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  9. 修正MYSQL错误数据的一个存储过程

    -- 添加索引 CREATE INDEX idx_STRUCTURE_ID ON t_resource_info(STRUCTURE_ID); DROP PROCEDURE IF EXISTS `P_ ...

  10. C# 键值对的类型

    一 C# 键值对类有以下类: ①    IDictionary<string, Object> idc = new Dictionary<string, object>(); ...