Author Topic: [not a bug] r2727: compilation error in posix/socket.cpp  (Read 671 times)

sojourner

  • Guest
[not a bug] r2727: compilation error in posix/socket.cpp
« on: 30 October 2011, 19:26:07 »
There appears to be some API version related problem (just guessing). Please take a look:

Quote
[build ]make
[ 26%] Built target streflop
[ 26%] Building CXX object source/shared_lib/CMakeFiles/libmegaglest.dir/sources/platform/posix/socket.cpp.o
/home/eye/tmp/megaglest/source/shared_lib/sources/platform/posix/socket.cpp: In static member function ‘static int Shared::Platform::UPNP_Tools::upnp_init(void*)’:
/home/eye/tmp/megaglest/source/shared_lib/sources/platform/posix/socket.cpp:2174:113: error: too many arguments to function ‘UPNPDev* upnpDiscover(int, const char*, const char*, int)’
/usr/include/miniupnpc/miniupnpc.h:45:26: note: declared here
/home/eye/tmp/megaglest/source/shared_lib/sources/platform/posix/socket.cpp: In static member function ‘static bool Shared::Platform::UPNP_Tools::upnp_add_redirect(int*, bool)’:
/home/eye/tmp/megaglest/source/shared_lib/sources/platform/posix/socket.cpp:2298:151: error: too many arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’
/usr/include/miniupnpc/upnpcommands.h:123:1: note: declared here
make[2]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/sources/platform/posix/socket.cpp.o] Error 1
make[1]: *** [source/shared_lib/CMakeFiles/libmegaglest.dir/all] Error 2
make: *** [all] Error 2

setup details:
(click to show/hide)
« Last Edit: 31 October 2011, 13:52:35 by tomreyn »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: svn revision 2727 - compilation error in posix/socket.cpp
« Reply #1 on: 31 October 2011, 00:50:05 »
This means you have an older version of miniupnpc. We recently upgraded our embedded copy of miniupnpc to 1.6, if you are having compile issues then your library is not the new version that we updated. For windows users they require downloading the updated win32_deps archive on sf, for linux / mac users they can use the flags below if they are using a dynamic version of the library to match the version they have on their OS. Unfortunately miniupnpc does not properly have version macro's etc making it impossible to properly detect the version on a developers system.

The cmake flags are all documented on the wiki: https://docs.megaglest.org/MG/Linux_Compiling

I have pasted the relevant info for convenience here.

-DMINIUPNPC_VERSION_PRE1_6=Off
-DMINIUPNPC_VERSION_PRE1_5=Off

If your miniupnpc library is pre 1.6 you must set that cmake variable to ON (and if is pre 1.5 additionally set that variable also)

-DMINIUPNPC_VERSION_PRE1_6=On
-DMINIUPNPC_VERSION_PRE1_5=On
« Last Edit: 18 June 2016, 18:00:37 by filux »

sojourner

  • Guest
Re: svn revision 2727 - compilation error in posix/socket.cpp
« Reply #2 on: 31 October 2011, 06:05:19 »
Thanks.
I had to use:
-DMINIUPNPC_VERSION_PRE1_6=On

 

anything