首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从源代码编译miniupnpc

从源代码编译miniupnpc
EN

Stack Overflow用户
提问于 2013-11-03 11:33:57
回答 1查看 2.3K关注 0票数 0

我试图从源代码(http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz)编译miniupnpc,并且遇到了一些错误。我已经安装了MinGW并将其添加到路径中。然后我提取源代码并运行mingw32make.bat,我不知道出了什么问题。下面是命令的输出

代码语言:javascript
复制
C:\Users\dev\tools\mingw\msys\1.0\home\Aidan\miniupnpc-1.8>>mingw32make.bat
mkdir dll
echo init > init
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -c -o dll/upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o wingenminiupnpcstrings.o wingenminiupnpcstrings.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/wingenminiupnpcstrings.o wingenminiupnpcstrings.c
gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
Windows 6.1 Build 7601 Service Pack 1
MiniUPnPc version 1.8
15 lines written to miniupnpcstrings.h.
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o miniwget.o miniwget.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/miniwget.o miniwget.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o minixml.o minixml.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/minixml.o minixml.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o igd_desc_parse.o igd_desc_parse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/igd_desc_parse.o igd_desc_parse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o minisoap.o minisoap.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/minisoap.o minisoap.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o miniupnpc.o miniupnpc.c
miniupnpc.c: In function 'upnpDiscover':
miniupnpc.c:422:9: warning: variable 'dwRetVal' set but not used [-Wunused-but-set-variable]
   DWORD dwRetVal = 0;
         ^
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/miniupnpc.o miniupnpc.c
miniupnpc.c: In function 'upnpDiscover':
miniupnpc.c:422:9: warning: variable 'dwRetVal' set but not used [-Wunused-but-set-variable]
   DWORD dwRetVal = 0;
         ^
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpreplyparse.o upnpreplyparse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/upnpreplyparse.o upnpreplyparse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnpcommands.o upnpcommands.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/upnpcommands.o upnpcommands.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o upnperrors.o upnperrors.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/upnperrors.o upnperrors.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o connecthostport.o connecthostport.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/connecthostport.o connecthostport.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o portlistingparse.o portlistingparse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/portlistingparse.o portlistingparse.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o receivedata.o receivedata.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/receivedata.o receivedata.c
ar cr libminiupnpc.a miniwget.o minixml.o igd_desc_parse.o minisoap.o miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o connecthostport.o portlistingparse
.o receivedata.o
gcc -enable-stdcall-fixup -o upnpc-static upnpc.o libminiupnpc.a -lws2_32 -liphlpapi
c:/users/dev/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: warning: cannot find entry symbol nable-stdcall-fixup; defaulting to
0000000000401000
dllwrap -k --driver-name gcc \
--def miniupnpc.def \
--output-def miniupnpc.dll.def \
--implib miniupnpc.lib -o miniupnpc.dll \
dll/miniwget.o dll/minixml.o dll/igd_desc_parse.o dll/minisoap.o dll/miniupnpc.o dll/upnpreplyparse.o dll/upnpcommands.o dll/upnperrors.o dll/connecthostport.o d
ll/portlistingparse.o dll/receivedata.o -lws2_32 -liphlpapi
dlltool: Syntax error in def file miniupnpc.def:5
dlltool: Syntax error in def file miniupnpc.def:5
echo miniupnpc.lib generated with miniupnpc.dll
miniupnpc.lib generated with miniupnpc.dll
gcc -enable-stdcall-fixup -o upnpc-shared dll/upnpc.o miniupnpc.lib -lws2_32 -liphlpapi
c:/users/dev/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: warning: cannot find entry symbol nable-stdcall-fixup; defaulting to
0000000000401000
dll/upnpc.o:upnpc.c:(.text+0x31): undefined reference to `_imp__UPNP_GetConnectionTypeInfo'
dll/upnpc.o:upnpc.c:(.text+0x8f): undefined reference to `_imp__UPNP_GetStatusInfo'
dll/upnpc.o:upnpc.c:(.text+0x157): undefined reference to `_imp__UPNP_GetLinkLayerMaxBitRates'
dll/upnpc.o:upnpc.c:(.text+0x289): undefined reference to `_imp__UPNP_GetExternalIPAddress'
dll/upnpc.o:upnpc.c:(.text+0x3cd): undefined reference to `_imp__UPNP_GetExternalIPAddress'
dll/upnpc.o:upnpc.c:(.text+0x43b): undefined reference to `_imp__UPNP_AddPortMapping'
dll/upnpc.o:upnpc.c:(.text+0x44e): undefined reference to `_imp__strupnperror'
dll/upnpc.o:upnpc.c:(.text+0x4c2): undefined reference to `_imp__UPNP_GetSpecificPortMappingEntry'
dll/upnpc.o:upnpc.c:(.text+0x4d1): undefined reference to `_imp__strupnperror'
c:/users/dev/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: dll/upnpc.o: bad reloc address 0x23 in section `.text.startup'
c:/users/dev/tools/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Makefile.mingw:64: recipe for target 'upnpc-shared' failed
mingw32-make: *** [upnpc-shared] Error 1
EN

回答 1

Stack Overflow用户

发布于 2014-01-19 21:13:54

  1. 选项-enable-stdcall-fixup需要以-Wl作为前缀,以便通过mingw32-g++正确地解析,因为当解析-e...时,-e...将被拆分为-e ...。这个前缀只是表示“不要将以下内容解析为,而是

warning: cannot find entry symbol nable-stdcall-fixup; defaulting

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19752479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档