[Feature request]: Build shared libraries
At least on Linux. Or is the API still too unstable?
I tried to do it a few months back but various parts in the API assume memory allocation on both shared library and API caller sides so this separation doesn't work. Doing it will require quite a lot of work and changes in these parts in the API. Unfortunately I don't think I'll have the time for it in the near future
Build shared libraries of "libCommon++.so libPacket++.so libPcap++.so" Is it possible to provide a way to switch from a static library to a dynamic library?
As I explained in the comment above this is not trivial because several parts in PcapPlusPlus API assume memory allocation on both sides (shared library and caller) so this separation doesn't work out-of-the-box.
I guess this is doable but will require a significant amount of efforts which I currently don't have...
Hi Could you point us to the issues & code areas which require work? Perhaps I can take it up.
To be honest, it's been a long time so I don't quite remember... but you can try to build the PcapPlusPlus as shared library, run the unit-tests and you'll probably bump into the issues.
I have met undefined reference problem several times, like
undefined reference to `pcpp::MacAddress::toString[abi:cxx11]() const'
and try several sequence of link libs
pthread
pcap
Common++
Pcap++
Packet++
And now I have no idea to solve the problem, maybe the only way is choose shared libs
I have met
undefined referenceproblem several times, likeundefined reference to `pcpp::MacAddress::toString[abi:cxx11]() const'
Are you trying to build PcapPlusPlus as a shared library?
I have met
undefined referenceproblem several times, likeundefined reference to `pcpp::MacAddress::toString[abi:cxx11]() const'Are you trying to build PcapPlusPlus as a shared library?
No, I just rebuild the latest PcapPlusPlus version(v20..08), then everything is OK
@lgbaldoni could you retry with cmake build system it should works properly.
@seladb maybe we can close this issue no ?
@clementperon I remember there we some problems with shared libraries, but I don't remember what they were and on which platforms. I guess we can close this issue now, but first maybe we can document how to compile PcapPlusPlus as static or shared libraries?
I'll close the issue now as building shared libraries is now supported. Thanks @clementperon for working on this!