Scanning dependencies of target PXESim
[ 14%] Building CXX object CMakeFiles/PXESim.dir/main.cpp.o
In file included from /home/paulo/sources/repos/personal/PXESim/main.cpp:2:
/home/paulo/sources/repos/personal/PXESim/libtins-TFTP/tftp.h: In member function ‘virtual Tins::TFTP* Tins::TFTP::clone() const’:
/home/paulo/sources/repos/personal/PXESim/libtins-TFTP/tftp.h:67:52: error: invalid new-expression of abstract class type ‘Tins::TFTP’
67 | TFTP *clone() const { return new TFTP(*this); }
| ^
/home/paulo/sources/repos/personal/PXESim/libtins-TFTP/tftp.h:35:11: note: because the following virtual functions are pure within ‘Tins::TFTP’:
35 | class TFTP : public PDU {
| ^~~~
In file included from /usr/include/tins/dns.h:39,
from /usr/include/tins/tins.h:33,
from /home/paulo/sources/repos/personal/PXESim/PXEClient.h:8,
from /home/paulo/sources/repos/personal/PXESim/main.cpp:1:
/usr/include/tins/pdu.h:516:18: note: ‘virtual void Tins::PDU::write_serialization(uint8_t*, uint32_t)’
516 | virtual void write_serialization(uint8_t* buffer, uint32_t total_sz) = 0;
| ^~~~~~~~~~~~~~~~~~~
/home/paulo/sources/repos/personal/PXESim/main.cpp: In function ‘bool sniff(Tins::Sniffer&, Tins::PacketSender&, PXEClient&)’:
/home/paulo/sources/repos/personal/PXESim/main.cpp:52:65: error: no matching function for call to ‘Tins::RawPDU::to<Tins::TFTP>()’
52 | const auto tftp = pdu->rfind_pdu<RawPDU>().to<TFTP>();
| ^
In file included from /usr/include/tins/tins.h:53,
from /home/paulo/sources/repos/personal/PXESim/PXEClient.h:8,
from /home/paulo/sources/repos/personal/PXESim/main.cpp:1:
/usr/include/tins/rawpdu.h:203:7: note: candidate: ‘template<class T> T Tins::RawPDU::to() const’
203 | T to() const {
| ^~
/usr/include/tins/rawpdu.h:203:7: note: template argument deduction/substitution failed:
/usr/include/tins/rawpdu.h: In substitution of ‘template<class T> T Tins::RawPDU::to() const [with T = Tins::TFTP]’:
/home/paulo/sources/repos/personal/PXESim/main.cpp:52:65: required from here
/usr/include/tins/rawpdu.h:203:7: error: invalid abstract return type ‘Tins::TFTP’
make[2]: *** [CMakeFiles/PXESim.dir/build.make:63: CMakeFiles/PXESim.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/PXESim.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Hi,
Tried to compile your project but having issues:
Can you help ?