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 

Problem compilation under WIN

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



Joined: 18 Nov 2009
Posts: 4

PostPosted: Wed Nov 18, 2009 8:13 am    Post subject: Problem compilation under WIN Reply with quote

1st post
Back to top
View user's profile Send private message
alkado



Joined: 18 Nov 2009
Posts: 4

PostPosted: Wed Nov 18, 2009 8:14 am    Post subject: Reply with quote

When i try to compile i see that:
Code:
C:\scupnp\miniupnpc-1.4>mingw32make.bat
mkdir dll
echo "" > init
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -c -o dll/upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o miniwget.o miniwget.c
miniwget.c:37:30: miniupnpcstrings.h: No such file or directory
miniwget.c: In function `miniwget2':
miniwget.c:157: error: syntax error before "OS_STRING"
miniwget.c:61: warning: statement with no effect
mingw32-make: *** [miniwget.o] Error 1

C:\scupnp\miniupnpc-1.4>


Im try to rename miniupnpcstrings.h.in to miniupnpcstrings.h after that comilation success, but are this step correct? (renaming)

Code:
C:\scupnp\miniupnpc-1.4>mingw32make.bat
mkdir dll
echo "" > init
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -c -o dll/upnpc.o upnpc.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o miniwget.o miniwget.c
miniwget.c: In function `miniwget2':
miniwget.c:61: warning: statement with no effect
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/miniwget.o miniwget.c
miniwget.c: In function `miniwget2':
miniwget.c:61: warning: statement with no effect
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o minixml.o minixml.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/minixml.o minixml.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o igd_desc_parse.o igd_desc_parse.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/igd_desc_parse.o igd_desc_pa
rse.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o minisoap.o minisoap.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/minisoap.o minisoap.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o miniupnpc.o miniupnpc.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/miniupnpc.o miniupnpc.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o upnpreplyparse.o upnpreplyparse.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/upnpreplyparse.o upnpreplypa
rse.c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o upnpcommands.o upnpcommands.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/upnpcommands.o upnpcommands.
c
gcc -Wall -Os -DNDEBUG -DSTATICLIB -c -o upnperrors.o upnperrors.c
gcc -Wall -Os -DNDEBUG -DMINIUPNP_EXPORTS -c -o dll/upnperrors.o upnperrors.c
ar cr libminiupnpc.a miniwget.o minixml.o igd_desc_parse.o minisoap.o miniupnpc.
o upnpreplyparse.o upnpcommands.o upnperrors.o
gcc -o upnpc-static upnpc.o libminiupnpc.a -lws2_32
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/min
iupnpc.o dll/upnpreplyparse.o dll/upnpcommands.o dll/upnperrors.o -lws2_32
echo miniupnpc.lib generated with miniupnpc.dll
miniupnpc.lib generated with miniupnpc.dll
gcc -o upnpc-shared dll/upnpc.o miniupnpc.lib -lws2_32
gcc -Wall -Os -DNDEBUG    testminixml.c minixml.o igd_desc_parse.o  -lws2_32 -o
testminixml
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2009
UPX 3.04w       Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 27th 2009

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
     45568 ->     24064   52.81%    win32/pe     upnpc-static.exe

Packed 1 file.
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2009
UPX 3.04w       Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 27th 2009

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
     11776 ->      6656   56.52%    win32/pe     upnpc-shared.exe

Packed 1 file.
C:\scupnp\miniupnpc-1.4>


I mean some not good message whith:
Code:
miniwget.c: In function `miniwget2':
miniwget.c:61: warning: statement with no effect
miniwget.c: In function `miniwget2':
miniwget.c:61: warning: statement with no effect
Back to top
View user's profile Send private message
alkado



Joined: 18 Nov 2009
Posts: 4

PostPosted: Wed Nov 18, 2009 8:56 am    Post subject: Reply with quote

As im understand, file miniupnpcstrings.h for Windows must be look like:
Code:
/* $Id: miniupnpcstrings.h.in,v 1.2 2009/10/30 09:18:18 nanard Exp $ */
/* Project: miniupnp
 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
 * Author: Thomas Bernard
 * Copyright (c) 2005-2009 Thomas Bernard
 * This software is subjects to the conditions detailed
 * in the LICENCE file provided within this distribution */
#ifndef __MINIUPNPCSTRINGS_H__
#define __MINIUPNPCSTRINGS_H__

#define OS_STRING "MINGW32_NT-5.1/1.0.11(0.46/3/2)"
#define MINIUPNPC_VERSION_STRING "1.4"

#endif
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1477

PostPosted: Wed Nov 18, 2009 10:41 am    Post subject: Reply with quote

I'm sorry there is no script to generate the miniupnpcstrings.h file for windows.
You should make a file containing strings like that :
Code:

/* Project: miniupnp
 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
 * Author: Thomas Bernard
 * Copyright (c) 2005-2009 Thomas Bernard
 * This software is subjects to the conditions detailed
 * in the LICENCE file provided within this distribution */
#ifndef __MINIUPNPCSTRINGS_H__
#define __MINIUPNPCSTRINGS_H__

#define OS_STRING "Windows/7.0.0000"
#define MINIUPNPC_VERSION_STRING "1.4"

#endif

In fact you could put whatever you like but the OS string is usualy "OS/Version"
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
alkado



Joined: 18 Nov 2009
Posts: 4

PostPosted: Wed Nov 18, 2009 11:16 am    Post subject: Reply with quote

Thnx for reply!
You tool work perfect =)

And some litle question,
why each time when i compile you sorce i obtain file whith difrent crc ?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1477

PostPosted: Wed Nov 18, 2009 3:30 pm    Post subject: Reply with quote

I guess the compiler puts some Timestamp inside the executable.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1477

PostPosted: Fri Dec 11, 2009 6:12 pm    Post subject: Reply with quote

miniupnpc-1.4.20091211.tar.gz includes an utility to generate the miniupnpcstrings.h file under windows (using MinGW).
Just run mingw32make.bat
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
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.