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

curl missing static lib #436

Closed
Optiligence opened this issue Jan 25, 2015 · 6 comments
Closed

curl missing static lib #436

Optiligence opened this issue Jan 25, 2015 · 6 comments

Comments

@Optiligence
Copy link
Contributor

I guess this is unintentional.
To solve, run configure explicitly with --enable-static.

@Optiligence
Copy link
Contributor Author

w8, the flag does not seem to be enough though

@Optiligence
Copy link
Contributor Author

Ok, so i built the static version using cmake (without tests – because there are missing CMakeLists, without the exe – because it broke compilation and with patching FindOpenSSL – because it was regexing a changed line of code) and despite issuing a »Static linking is broken!« it built fine and seems to work as far as i can tell.
I just would like having this available right away.

@Optiligence
Copy link
Contributor Author

The intention for this was, that i wanted to use curl-config --static-libs so i wouldn’t have to specify all the dependecies myself. I configured a static package with --enable-static --disable-shared as it doesn’t seem to be possible to build both together. The resulting curl-config executable provided a hand full of link-flags, but not enough, so this all seemed kind of pointless.

@Alexpux
Copy link
Member

Alexpux commented Feb 7, 2015

I'm upload yesterday new cur package with both shared and static libraries.

@Alexpux Alexpux closed this as completed Feb 7, 2015
@Optiligence
Copy link
Contributor Author

Yeah, thanks for that.
As i mentioned above, the thing is, how am i supposed to link to that?
Compiling the following code with g++ main.cpp -static -DCURL_STATICLIB $(curl-config --static-libs)
is not sufficient to link correctly.

#include <curl/curl.h>
int main() {
    CURL * const curl = curl_easy_init();
    if (!curl) {
        curl_easy_cleanup(curl);
    }
}

@andreldm
Copy link

I'm kind of having the same trouble with libcurl. Before migrating to MSYS2/MinGW-64, I used to compile it and all I needed to ship with the app was libcurl.dll. Now it depends on lots of others libs:

libcurl-4.dll
    LIBEAY32.dll
    libidn-11.dll
        libiconv-2.dll
        libintl-8.dll
    librtmp-1.dll
        libgmp-10.dll
        libgnutls-30.dll
            libhogweed-4-0.dll
            libp11-kit-0.dll
            libtasn1-6.dll
        libhogweed-4-0.dll
        libnettle-6-0.dll
    libssh2-1.dll
    SSLEAY32.dll
    zlib1.dll
(duplicates removed)

I've tried to set the "-static" flag, but no cigar:
http://pastebin.com/e2F1DbYc

Strangely the executable went from ~2mb to ~6mb, but was requesting the same dlls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants