Re: missing libraries for static linked libcurl
Date: Thu, 5 Dec 2019 23:57:40 +0100 (CET)
On Tue, 3 Dec 2019, acorn12 via curl-library wrote:
> When I compile it under Mint 19.2 and try the app under Mint on the machine
> it is compiled on it runs without issues.
>
> On other machines (one Mint 18.2, the other not yet sure of the specific
> version of Linux), I get various errors about missing libraries, such as
Are you distributing the same libcurl binary shared library to the different
distros?
> If I copy the file libcurl.so.4 to the same directory as the executable, I
> end up with errors
On Linux, apps don't load shared libraries from the same dirs as the
applications just because they happen to be there, you need to also change the
path for where ld.so finds shareed libraries.
> Looking through some of the documentation, I see that I would need to add
> all required dependencies to my linker command line
That's only true if you link with libcurl as a static library, not when used
as shared.
> but I have no idea which ones I would need or where I would find them.
curl-config and pkg-config are there to help you figure that out. But yes,
linking statically is a bit of a pain.
> The original Mint version runs without issues on the PC they are compiled
> on, but moving the executable to anothe rPC causes the issues described.
That's not a curl issue, that's how Linux typically works and you're not
supposed to do it like that. I'm sure both those versions Mint provide libcurl
in their package "stores" so you'd be much better off just using that version.
> Thus the main question is how do I get a fully static package built?
Step one: build a static libcurl. Then make sure all the dependencies you
built it to use are also available as static libs. Then make sure you link
with only the static versions with your application. And you need to put the
libs in the right order on the command line.
> What are the important parameters for the gtkbuild command line and which
> additional libraries would I need and where do I find them.
I don't know gtkbuild.
-- / daniel.haxx.se | Get the best commercial curl support there is - from me | Private help, bug fixes, support, ports, new features | https://www.wolfssl.com/contact/ ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2019-12-06