Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Build shared libraries #61

Closed
lgbaldoni opened this issue Aug 17, 2017 · 11 comments
Closed

[Feature request]: Build shared libraries #61

lgbaldoni opened this issue Aug 17, 2017 · 11 comments

Comments

@lgbaldoni
Copy link
Contributor

At least on Linux. Or is the API still too unstable?

@seladb
Copy link
Owner

seladb commented Aug 17, 2017

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

@daoxuans
Copy link

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?

@seladb
Copy link
Owner

seladb commented Jul 11, 2018

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...

@bornlibra23
Copy link

Hi Could you point us to the issues & code areas which require work? Perhaps I can take it up.

@seladb
Copy link
Owner

seladb commented Nov 26, 2019

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.

@DinoStray
Copy link
Contributor

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

@seladb
Copy link
Owner

seladb commented Sep 4, 2020

I have met undefined reference problem several times, like

 undefined reference to `pcpp::MacAddress::toString[abi:cxx11]() const'

Are you trying to build PcapPlusPlus as a shared library?

@DinoStray
Copy link
Contributor

I have met undefined reference problem several times, like

 undefined 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

@clementperon
Copy link
Collaborator

clementperon commented Jan 28, 2023

@lgbaldoni could you retry with cmake build system it should works properly.

@seladb maybe we can close this issue no ?

@seladb
Copy link
Owner

seladb commented Jan 30, 2023

@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?

@seladb
Copy link
Owner

seladb commented Feb 1, 2023

I'll close the issue now as building shared libraries is now supported. Thanks @clementperon for working on this!

@seladb seladb closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants