vwifi-guest doen't compile in Debian Buster
Closed this issue · 2 comments
Raizo62 commented
g++ -O4 -Wall -fomit-frame-pointer -o obj/cvwifiguest.o -I/usr/include/libnl3 -lnl-genl-3 -lnl-3 -lpthread -c src/cvwifiguest.cc
In file included from src/cvwifiguest.h:12,
from src/cvwifiguest.cc:15:
src/cmonwirelessdevice.h:17:14: error: ‘function’ in namespace ‘std’ does not name a template type
typedef std::function<void(WirelessDevice)> CallbackFunction ;
^~~~~~~~
src/cmonwirelessdevice.h:17:9: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
src/cmonwirelessdevice.h:7:1:
+#include <functional>
#include <mutex>
src/cmonwirelessdevice.h:17:9:
typedef std::function<void(WirelessDevice)> CallbackFunction ;
^~~
src/cmonwirelessdevice.h:75:2: error: ‘CallbackFunction’ does not name a type
CallbackFunction _newinet_cb ;
^~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:81:2: error: ‘CallbackFunction’ does not name a type
CallbackFunction _delinet_cb ;
^~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:88:2: error: ‘CallbackFunction’ does not name a type
CallbackFunction _initinet_cb ;
^~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:113:26: error: ‘CallbackFunction’ has not been declared
void setNewInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:120:27: error: ‘CallbackFunction’ has not been declared
void setInitInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:129:26: error: ‘CallbackFunction’ has not been declared
void setDelInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~
src/cvwifiguest.cc: In member function ‘int VWifiGuest::start()’:
src/cvwifiguest.cc:779:105: error: no matching function for call to ‘MonitorWirelessDevice::setNewInetCallback(VWifiGuest::start()::<lambda(WirelessDevice)>)’
monwireless->setNewInetCallback([this](WirelessDevice wd) { return handle_new_winet_notification(wd);});
^
In file included from src/cvwifiguest.h:12,
from src/cvwifiguest.cc:15:
src/cmonwirelessdevice.h:113:7: note: candidate: ‘void MonitorWirelessDevice::setNewInetCallback(int)’
void setNewInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:113:7: note: no known conversion for argument 1 from ‘VWifiGuest::start()::<lambda(WirelessDevice)>’ to ‘int’
src/cvwifiguest.cc:780:105: error: no matching function for call to ‘MonitorWirelessDevice::setDelInetCallback(VWifiGuest::start()::<lambda(WirelessDevice)>)’
monwireless->setDelInetCallback([this](WirelessDevice wd) { return handle_del_winet_notification(wd);});
^
In file included from src/cvwifiguest.h:12,
from src/cvwifiguest.cc:15:
src/cmonwirelessdevice.h:129:7: note: candidate: ‘void MonitorWirelessDevice::setDelInetCallback(int)’
void setDelInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:129:7: note: no known conversion for argument 1 from ‘VWifiGuest::start()::<lambda(WirelessDevice)>’ to ‘int’
src/cvwifiguest.cc:781:107: error: no matching function for call to ‘MonitorWirelessDevice::setInitInetCallback(VWifiGuest::start()::<lambda(WirelessDevice)>)’
monwireless->setInitInetCallback([this](WirelessDevice wd) { return handle_init_winet_notification(wd);});
^
In file included from src/cvwifiguest.h:12,
from src/cvwifiguest.cc:15:
src/cmonwirelessdevice.h:120:7: note: candidate: ‘void MonitorWirelessDevice::setInitInetCallback(int)’
void setInitInetCallback(CallbackFunction);
^~~~~~~~~~~~~~~~~~~
src/cmonwirelessdevice.h:120:7: note: no known conversion for argument 1 from ‘VWifiGuest::start()::<lambda(WirelessDevice)>’ to ‘int’
make: *** [Makefile:75: obj/cvwifiguest.o] Error 1
Raizo62 commented
if I follow the compiler's advice, and add in cmonwirelessdevice.h :
#include <functional>
The compiler says :
g++ -O4 -Wall -fomit-frame-pointer -o obj/cvwifiguest.o -I/usr/include/libnl3 -lnl-genl-3 -lnl-3 -lpthread -c src/cvwifiguest.cc
In function ‘bool VWifiGuest::get_pmaddr(ether_addr&, const char*)’,
inlined from ‘void VWifiGuest::handle_new_winet_notification(WirelessDevice)’ at src/cvwifiguest.cc:1031:15:
src/cvwifiguest.cc:1095:12: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 16 equals destination size [-Wstringop-truncation]
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/cvwifiguest.cc: In member function ‘bool VWifiGuest::get_pmaddr(ether_addr&, const char*)’:
src/cvwifiguest.cc:1095:12: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 16 equals destination size [-Wstringop-truncation]
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raizo62 commented
I have change "strncpy" by "memcpy"