编译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. cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mongo:mongo-client'.

    cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element ...

  2. MpLab设置编译文件输出路径

    MpLab设置编译文件输出路径

  3. BJOI2019退役记

    update:不想更这个游记……感觉更了只能说明自己菜得只会打嘴炮……那就让这个污痕一直残缺吧 太菜了,就不发具体分数了…… 被北师大附中的高一选手们吊打致死,退役了 4.6 4.7 4.13 4.1 ...

  4. HTML 上标和下标

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. codeforces round373(div.2) 题解

    这一把打得还算过得去... 最大问题在于A题细节被卡了好久...连续被hack两次... B题是个规律题...C题也是一个细节题...D由于不明原因标程错了被删掉了...E是个线段树套矩阵... 考试 ...

  6. [LeetCode] Remove Nth Node From End of List 快慢指针

    Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...

  7. CC2540介绍

    1. 介绍 CC2540是一款2.4GHz Bluetooth® low energy SOC,基于8051 MCU 首先,你需要硬件设备 笔者的开发板为CC2540DK 得到开发板的同时应该还有TI ...

  8. 19年的桌面KDE的风雨和陪伴,没有什么能够割舍

    概述 KDE是史上功能最强大的桌面环境之一:开源且可自由使用.19年前,1996年10月14日,德国程序员 Matthias Ettrich 开始了这个美观的桌面环境的开发.KDE 提供了用户界面以及 ...

  9. 解决 GTK+/GNOME 3 环境下 Java Swing 程序使用本地 GTK+ 主题时菜单无边框 bug 的方法

    在 GTK+/GNOME 3 环境下采用默认的 Adwaita 主题时,Java Swing 程序如果使用本地 GTK+ 主题会出现菜单无边框的 bug,这个问题也可能在其他常用的 GTK+ 主题中出 ...

  10. solr6.6安装

    1. 确保系统已经安装jdk1.8,以及Tomcat8. 注:使用Tomcat7会出现很多问题,我遇到的是直接打不开solr的index页面,看网上有网友说还会遇到各种css.js资源404..还有l ...