You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net.cpp: In function ‘void ThreadMapPort()’:
net.cpp:1640:25: error: too few arguments to function ‘int UPNP_GetValidIGD(UPNPDev*, UPNPUrls*, IGDdatas*, char*, int, char*, int)’
1640 | r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from net.cpp:40:
/usr/include/miniupnpc/miniupnpc.h:122:1: note: declared here
122 | UPNP_GetValidIGD(struct UPNPDev * devlist,
| ^~~~~~~~~~~~~~~~
The following patch (proposed by Gui-Yue [email protected]) fixed the problem:
--- a/src/net.cpp+++ b/src/net.cpp@@ -1636,9 +1636,14 @@
struct UPNPUrls urls;
struct IGDdatas data;
int r;
- r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));+ char errorMsg[256];+ #if MINIUPNPC_API_VERSION >= 18+ r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), errorMsg, sizeof(errorMsg));+ #else+ r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));+ #endif
if (r == 1)
{
if (fDiscover) {
char externalIPAddress[40];
My solution to this issue:
According to the error message, the issue lies in the call to the
UPNP_GetValidIGD function, indicating an insufficient number of arguments.
In newer versions, the function signature of UPNP_GetValidIGD has been
updated with additional parameters, such as char *errorMsg and int
errorMsgLen. I resolved the issue by adding the required parameters for the
new version, while also incorporating conditional checks to ensure
compatibility with older versions of miniupnpc.I have tested this solution
locally,and it works well.The debpatch is in the attachment.Please let me
know whether this solution can be accepted.
Gui-Yue
Best regards
The text was updated successfully, but these errors were encountered:
onlyjob
changed the title
0.21.4: FTBFS ("too few arguments to function") [PATCH]
0.21.4: FTBFS with miniupnpc 2.2.8 ("too few arguments to function") [PATCH]
Jan 29, 2025
As reported in Debian, Litecoin 0.21.4 FTBFS as follows:
The following patch (proposed by Gui-Yue [email protected]) fixed the problem:
The text was updated successfully, but these errors were encountered: