News:

Check out the MegaGlest Wiki! Anyone can be an editor, and we want you!

Main Menu

[not a bug] r2727: compilation error in posix/socket.cpp

Started by sojourner, 30 October 2011, 19:26:07

sojourner

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:
[spoiler]
[build ]uname -a
Linux hu 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux



[build ]cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"




[build ]svn status ../
?       ../build
?       ../.anjuta
?       ../source/tools/convert_faction_xml2html (2)




[build ]svn update ../
At revision 2727.




[build ]cmake -DCMAKE_INSTALL_PREFIX= ..
-- Build type for this compile will be:
-- Detected GNUC Compiler...
-- Found SVN and using SVN version stamping...
-- *NOTE: NOT USING a Custom Data Install Path...
-- **Found game source code.
-- Will try to build MegaGlest shared library
-- #2 CURL RET = 0 using CURL dynamic libs: -L/usr/lib/x86_64-linux-gnu -lcurl -Wl,-Bsymbolic-functions
-- curl version=[7.21.6]
-- Looking for dynamic Xerces-C lib...
-- Found dynamic Xerces-C lib [/usr/lib/libxerces-c.so]
-- LUA_INC: /usr/include/lua5.1
-- LUA_LIB: /usr/lib/x86_64-linux-gnu/liblua5.1.so
-- Found Lua library: /usr/lib/x86_64-linux-gnu/liblua5.1.so
-- Found Lua headers: /usr/include/lua5.1
-- Found FTGL libraries at /usr/lib/libftgl.so and includes at /usr/include
-- **NOTE: FTGL font support was detected and enabled.
-- *** Searching for miniupnpc since WANT_STATIC_LIBS is off ...
-- *** Using SHARED miniupnpc found in [/usr/include/miniupnpc] MINIUPNP_FOUND [TRUE] MINIUPNP_LIBRARY [/usr/lib/libminiupnpc.so]
-- *** Searching for libircclient since WANT_STATIC_LIBS is off ...
-- *** Using SHARED libircclient found in [/usr/include/libircclient] IRCCLIENT_FOUND [TRUE] IRCCLIENT_LIBRARY [/usr/lib/libircclient.so]
-- Building shared game library as a STATIC library and saving to []
-- EXTERNAL_LIBS = [-L/usr/lib/x86_64-linux-gnu -lcurl -Wl,-Bsymbolic-functions;/usr/lib/libSDLmain.a;/usr/lib/libSDL.so;-lpthread;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/libGL.so;/usr/lib/x86_64-linux-gnu/libSM.so;/usr/lib/x86_64-linux-gnu/libICE.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;/usr/lib/libxerces-c.so;/usr/lib/libopenal.so;/usr/lib/x86_64-linux-gnu/liblua5.1.so;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libfontconfig.so;/usr/lib/libftgl.so;/usr/lib/libminiupnpc.so;/usr/lib/libircclient.so]
-- Will try to build MegaGlest game
-- Looking for dynamic Xerces-C lib...
-- Found dynamic Xerces-C lib [/usr/lib/libxerces-c.so]
-- LUA_INC: /usr/include/lua5.1
-- LUA_LIB: /usr/lib/x86_64-linux-gnu/liblua5.1.so
-- Found Lua library: /usr/lib/x86_64-linux-gnu/liblua5.1.so
-- Found Lua headers: /usr/include/lua5.1
-- #2 CURL RET = 0 using CURL dynamic libs: -L/usr/lib/x86_64-linux-gnu -lcurl -Wl,-Bsymbolic-functions
-- Will try to build MegaGlest map editor
-- DEBUG FreeBSD: /usr/bin/wx-config
-- run the wx-config program to get cxxflags:
-- /usr/bin/wx-config  --cxxflags
-- Will try to build MegaGlest model viewer
-- Looking for dynamic Xerces-C lib...
-- Found dynamic Xerces-C lib [/usr/lib/libxerces-c.so]
-- DEBUG FreeBSD: /usr/bin/wx-config
-- run the wx-config program to get cxxflags:
-- /usr/bin/wx-config  --cxxflags
-- Will try to build MegaGlest Configurator
-- Looking for dynamic Xerces-C lib...
-- Found dynamic Xerces-C lib [/usr/lib/libxerces-c.so]
-- DEBUG FreeBSD: /usr/bin/wx-config
-- run the wx-config program to get cxxflags:
-- /usr/bin/wx-config  --cxxflags
-- Will try to build MegaGlest model import/export tools
-- **Found game data.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eye/tmp/megaglest/build
[/spoiler]

softcoder

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

sojourner