News:

Want to praise Simutrans?
Your feedback is important for us ;D.

does not compile with miniupnpc 2.2.8

Started by tastytea, June 29, 2024, 10:49:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tastytea

i'm getting the error "too few arguments to function int UPNP_GetValidIGD...". i believe it is because UPNP_GetValidIGD() got changed in 2.2.8: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.2.8.tar.gz

x86_64-pc-linux-gnu-g++ -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -DMULTI_THREAD -DNDEBUG -I/usr/include/freetype2 -DUSE_UPNP -DUSE_FLUIDSYNTH_MIDI -DREVISION=11164 -Wall -Wextra -Wcast-qual -Wpointer-arith -Wcast-align  -I/usr/include/SDL2 -D_REENTRANT -DCOLOUR_DEPTH=16 -c -MMD -o build/default/src/simutrans/network/network.o src/simutrans/network/network.cc
src/simutrans/network/network.cc: In function 'bool prepare_for_server(char*, char*, int)':
src/simutrans/network/network.cc:984:33: error: too few arguments to function 'int UPNP_GetValidIGD(UPNPDev*, UPNPUrls*, IGDdatas*, char*, int, char*, int)'
  984 |                 UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof(lanaddr) );
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/simutrans/network/network.cc:958:
/usr/include/miniupnpc/miniupnpc.h:122:1: note: declared here
  122 | UPNP_GetValidIGD(struct UPNPDev * devlist,
      | ^~~~~~~~~~~~~~~~
src/simutrans/network/network.cc: In function 'void remove_port_forwarding(int)':
src/simutrans/network/network.cc:1043:33: error: too few arguments to function 'int UPNP_GetValidIGD(UPNPDev*, UPNPUrls*, IGDdatas*, char*, int, char*, int)'
 1043 |                 UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof(lanaddr) );
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/miniupnpc/miniupnpc.h:122:1: note: declared here
  122 | UPNP_GetValidIGD(struct UPNPDev * devlist,
      | ^~~~~~~~~~~~~~~~
make: *** [common.mk:50: build/default/src/simutrans/network/network.o] Error 1

with miniupnpc-2.2.7 it works fine.

prissi

The nightly should compile with 2.2.8 and 2.2.7. But unless you want to host a server behind a uPnP router, you do not need libupnpc and can undefine it in the makefile.