编译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. nginx访问控制allow、deny(ngx_http_access_module)

    单看nginx模块名ngx_http_access_module,很多人一定很陌生,但是deny和allow相比没一个人不知道的,实际上deny和allow指令属于ngx_http_access_mo ...

  2. iOS-文本段落样式NSMutableParagraphStyle与NSParagraphStyle的使用和一些富文本处理属性

    开发过程中,经常会遇到动态计算行高的问题, - (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)op ...

  3. [luoguP2224] [HNOI2001]产品加工(背包DP)

    传送门 f[i][j]表示第一个机器耗时j,第二个机器耗时f[i][j] 第一维可以滚掉 #include <cstdio> #include <cstring> #inclu ...

  4. JAVA简易的注册会员系统

    public class Login { public static void main(String[] args) { System.out.println("*****欢迎进入注册系统 ...

  5. 调试Java代码(Eclipse)汇总

    Java 10个调试技巧(基础❤❤❤❤❤) Eclipse断点调试(和上一篇基本类似,补充❤❤) 使用Eclipse开发和调试java程序(从安装eclipse开始,特别细,有设置条件断点,回退的具体 ...

  6. Iframe载入页面 及 跳转页面

    原文发布时间为:2009-05-05 -- 来源于本人的百度文章 [由搬家工具导入] 第一个文件 frame1.html <!DOCTYPE html PUBLIC "-//W3C// ...

  7. C++ 求幂的运算符是什么?

    1.VB里面求幂的运算符是“^” 2.C++没有求幂的运算符, c++头文件加 #include<math.h>使用pow(x,y),可算出x的y次幂 3.C++中 “^”是按位“异或”运 ...

  8. sql语句中的[]中括号(转)

    下面有关sql语句中[]的信息适用于Sql Server.Access等多种数据库. 1.sql语句中加[]是为了防止歧义,避免与系统保留关键字冲突,使计算机能识别.sql语句中有些字段可能是关键字, ...

  9. Python学习杂记_10_三元运算符

    常用三元运算符来简化分支和循环的代码: 分支简化: a = 1b = 2c = a if a > 1 else bprint(c) # 以上几行等同于 a = 1b = 2if a >1: ...

  10. mysql error 1093 解决办法

    mysql> select * from t; +----+ | id | +----+ | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | | 9 ...