curl-library
Re: Can't build CURL with nghttp2 statically
Date: Tue, 28 Nov 2017 09:18:29 +0100
Op 28 nov. 2017, om 00:28 heeft Ray Satiro via curl-library <curl-library_at_cool.haxx.se> het volgende geschreven:
>
> On 11/27/2017 6:13 PM, Thomas van Hesteren via curl-library wrote:
>>>
>>> Op 27 nov. 2017, om 23:52 heeft Ray Satiro via curl-library <curl-library_at_cool.haxx.se <mailto:curl-library_at_cool.haxx.se>> het volgende geschreven:
>>>
>>> On 11/27/2017 4:53 PM, Thomas van Hesteren via curl-library wrote:
>>>> As you stated I have updated the code to:
>>>> i686-w64-mingw32-g++ -Wall -static Programm.cpp -o Programm.exe -I/opt/mingw64/Win32/include -L/opt/mingw64/Win32/lib -static-libgcc -static-libstdc++ -DCURL_STATICLIB -DNGHTTP2_STATICLIB -lcurl -lnghttp2 -lssl -lcrypto -lssl -lcrypto -lz -lpthread -lws2_32 -std=c++11
>>>>
>>>> However, the errors stay.
>>>
>>> Please stop top-posting it makes the conversation harder to follow [1]. The error you are seeing is because I think you can only build libcurl against static or dynamic nghttp2 at one time for windows. Try building libcurl like CPPFLAGS="-DNGHTTP2_STATICLIB" ./configure ... and then libcurl.a expect the regular symbols in nghttp2 static.
>>>
>>> You may need LDFLAGS="-static" PKG_CONFIG="pkg-config --static" to build a static curl.exe
>>>
>>> [1]: https://curl.haxx.se/mail/etiquette.html#Do_Not_Top_Post <https://curl.haxx.se/mail/etiquette.html#Do_Not_Top_Post>
>>> -------------------------------------------------------------------
>>> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library <https://cool.haxx.se/list/listinfo/curl-library>
>>> Etiquette: https://curl.haxx.se/mail/etiquette.html <https://curl.haxx.se/mail/etiquette.html>
>>
>>
>> I tried your comment and I build curl with the following command:
>> CPPFLAGS="-DNGHTTP2_STATICLIB" ./configure --host=i686-w64-mingw32 --prefix=/opt/mingw64/Win32 --with-ssl=/opt/mingw64/Win32 --with-zlib=/opt/mingw64/Win32 --with-nghttp2=/opt/mingw64/Win32 --disable-ldap --disable-ldaps LDFLAGS="-static" PKG_CONFIG="pkg-config --static"
>>
>> However, when I run the make command it fails on building curl.exe with the following errors:
>> CCLD curl.exe
>> curl-slist_wc.o:slist_wc.c:(.text+0x1a): undefined reference to `_imp__curl_slist_append'
>> curl-slist_wc.o:slist_wc.c:(.text+0x69): undefined reference to `_imp__curl_slist_free_all'
>> curl-slist_wc.o:slist_wc.c:(.text+0x93): undefined reference to `_imp__curl_slist_free_all'
>
> ...
>
>> curl-tool_writeout.o:tool_writeout.c:(.text+0x40f): undefined reference to `_imp__curl_mfprintf'
>> curl-tool_writeout.o:tool_writeout.c:(.text+0x443): undefined reference to `_imp__curl_easy_getinfo'
>> curl-tool_writeout.o:tool_writeout.c:(.text+0x464): undefined reference to `_imp__curl_mfprintf'
>> curl-tool_writeout.o:tool_writeout.c:(.text+0x498): undefined reference to `_imp__curl_easy_getinfo'
>> collect2: error: ld returned 1 exit status
>> Makefile:822: recipe for target 'curl.exe’ failed
>>
>> What am I doing wrong?
>
> If you want a fully static curl.exe you probably need --disable-shared or to pass special curl_LDFLAGS every time you call make like this:
>
> make V=1 curl_LDFLAGS=-all-static
> make install curl_LDFLAGS=-all-static
>
> -------------------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html
I really want to thank you. I have been looking for this a very very very…. very long time and I finally managed to build a static lib curl version with both nghttp2 and openssl support! Thank you very much!
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-11-28