miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help!Failed to compile!

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Compilation/Installation
View previous topic :: View next topic  
Author Message
longshao



Joined: 17 Jan 2014
Posts: 5
Location: China

PostPosted: Fri Jan 17, 2014 7:34 am    Post subject: Help!Failed to compile! Reply with quote

I have installed mingw, version 0.6.2-beta-20131004-1.
When i compile miniupnpc in 64bits Win7, It's failed!
The miniupnpc version is miniupnpc-1.8.20131209.
The error information is:
Code:

F:\BitcoinWin\miniupnpc-1.8.20131209>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 wingenminiupnpcstringswingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
Windows 6.1 Build 7600
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:437: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/miniupn
pc.o miniupnpc.c
miniupnpc.c: In function 'upnpDiscover':
miniupnpc.c:437: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:/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
dll/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:/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:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: dll/upnpc.o: bad reloc address 0x23 in section `.text.startup'
c:/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
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Jan 17, 2014 7:55 am    Post subject: Reply with quote

first you can edit the mingw32make.bat file and remove "-enable-stdcall-fixup" option
I see that upnpc-static.exe is compiled successfuly.
There is only a problem with the shared library version.

I don't understand why there is the error dlltool: Syntax error in def file miniupnpc.def:5
It has always worked well... I should try with newer mingw32 versions.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
longshao



Joined: 17 Jan 2014
Posts: 5
Location: China

PostPosted: Fri Jan 17, 2014 8:30 am    Post subject: Reply with quote

I will try.

I want to compile Bitcoin's source code in 64bits Win7. Bitcoin uses miniupnpc. It tell me how to compile miniupnpc In file ( build-msw.md ).

Code:

MiniUPnPc
---------
UPnP support is optional, make with `USE_UPNP=` to disable it.

MSYS shell:

   cd /c/miniupnpc-1.6-mgw
   make -f Makefile.mingw
   mkdir miniupnpc
   cp *.h miniupnpc/


or

Code:

run mingw32make.bat in CMD.


But it failed when i compile miniupnpc, so i come here to request help.
Back to top
View user's profile Send private message
longshao



Joined: 17 Jan 2014
Posts: 5
Location: China

PostPosted: Fri Jan 17, 2014 8:44 am    Post subject: Reply with quote

I can't find "-enable-stdcall-fixup" option in the mingw32make.bat file.
I find it in the Makefile.mingw file. I remove it. But it still failed.
Code:

F:\BitcoinWin\miniupnpc-1.8.20131209>mingw32make.bat
gcc   wingenminiupnpcstrings.o  -lws2_32 -liphlpapi -o wingenminiupnpcstrings
wingenminiupnpcstrings miniupnpcstrings.h.in miniupnpcstrings.h
Windows 6.1 Build 7600
MiniUPnPc version 1.8
15 lines written to miniupnpcstrings.h.
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DSTATICLIB -c -o miniwget.o miniwge
t.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/miniwge
t.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 minisoap.o minisoa
p.c
gcc -Wall -Os -DNDEBUG -D_WIN32_WINNT=0X501 -DMINIUPNP_EXPORTS -c -o dll/minisoa
p.o minisoap.c
ar cr libminiupnpc.a miniwget.o minixml.o minisoap.o
gcc -o upnpc-static upnpc.o libminiupnpc.a -lws2_32 -liphlpapi
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
dll/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 -o upnpc-shared dll/upnpc.o miniupnpc.lib -lws2_32 -liphlpapi
dll/upnpc.o:upnpc.c:(.text+0x31): undefined reference to `_imp__UPNP_GetConnecti
onTypeInfo'
dll/upnpc.o:upnpc.c:(.text+0x8f): undefined reference to `_imp__UPNP_GetStatusIn
fo'
dll/upnpc.o:upnpc.c:(.text+0x157): undefined reference to `_imp__UPNP_GetLinkLay
erMaxBitRates'
dll/upnpc.o:upnpc.c:(.text+0x289): undefined reference to `_imp__UPNP_GetExterna
lIPAddress'
dll/upnpc.o:upnpc.c:(.text+0x3cd): undefined reference to `_imp__UPNP_GetExterna
lIPAddress'
dll/upnpc.o:upnpc.c:(.text+0x43b): undefined reference to `_imp__UPNP_AddPortMap
ping'
dll/upnpc.o:upnpc.c:(.text+0x44e): undefined reference to `_imp__strupnperror'
dll/upnpc.o:upnpc.c:(.text+0x4c2): undefined reference to `_imp__UPNP_GetSpecifi
cPortMappingEntry'
dll/upnpc.o:upnpc.c:(.text+0x4d1): undefined reference to `_imp__strupnperror'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: dll/upnpc.
o: bad reloc address 0x23 in section `.text.startup'
c:/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
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Jan 17, 2014 9:02 am    Post subject: Reply with quote

upnpc-shared.exe failed to compile.
But I dont think you need it to compile bitcoin.
You only need miniupnpc.dll / miniupnpc.lib I guess. (or just the libminiupnpc.a static library ?)
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
longshao



Joined: 17 Jan 2014
Posts: 5
Location: China

PostPosted: Fri Jan 17, 2014 10:59 am    Post subject: Reply with quote

I know how to resolve it!
http://blog.csdn.net/hacode/article/details/17020689
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1445

PostPosted: Fri Jan 17, 2014 11:03 am    Post subject: Reply with quote

longshao wrote:
I know how to resolve it!
http://blog.csdn.net/hacode/article/details/17020689

The problem is I don't understand chinese Smile
Can you explain here what changes are needed ?
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
aryajur



Joined: 21 Jun 2014
Posts: 1
Location: San Jose

PostPosted: Sat Jun 21, 2014 3:21 pm    Post subject: Reply with quote

I downloaded the latest code from github and tried to compile on windows I get a similar error. Translating the above page in Google gives some instructions. I cannot paste it here because this is my first post. I will try to follow them and see if I can fix it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Compilation/Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.