digitalmars.D.learn - std.net.curl is not working?
- mab (27/27) Apr 26 2013 Why i get the following Error, when i try to compile a simple
- qznc (3/32) Apr 26 2013 You have to link libcurl via argument:
- mab (10/10) Apr 26 2013 Thank you for answering. But it didnt work.
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/8) Apr 26 2013 Try providing the directory that the curl library file is in:
- Jordi Sayol (9/22) Apr 26 2013 You need to install the development curl package:
- mab (5/11) Apr 26 2013 [...]
- John Colvin (8/18) Apr 26 2013 Do you know what the libcurl library is actually called on your
- ollie (3/5) Apr 26 2013 These functions are defined in libcurl. Make sure you have installed
Why i get the following Error, when i try to compile a simple "Hello World" that imports std.net.curl= The Error: /usr/lib/x86_64-linux-gnu/libphobos2.a(curl.o): In function `_D3std3net4curl4Curl19_sharedStaticCtor28FZv': std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticCtor28FZv+0xf): undefined reference to `curl_global_init' /usr/lib/x86_64-linux-gnu/libphobos2.a(curl.o): In function `_D3std3net4curl4Curl19_sharedStaticDtor29FZv': std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticDtor29FZv+0x5): undefined reference to `curl_global_cleanup' collect2: ld returned 1 exit status --- errorlevel 1 The Code: import std.stdio; import std.net.curl; void main() { writeln("hello world"); } My Testsystem: Debian 2013 x86_64 GNU/Linux curl is installed by apt-get install curl. Thanks!
Apr 26 2013
Fri, 26 Apr 2013 19:25:16 +0200: mab wroteWhy i get the following Error, when i try to compile a simple "Hello World" that imports std.net.curl= The Error: function `_D3std3net4curl4Curl19_sharedStaticCtor28FZv': std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticCtor28FZv+0xf): undefined reference to `curl_global_init' /usr/lib/x86_64-linux-gnu/libphobos2.a(curl.o): In function `_D3std3net4curl4Curl19_sharedStaticDtor29FZv': std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticDtor29FZv+0x5): undefined reference to `curl_global_cleanup' collect2: ld returned 1 exit status --- errorlevel 1 The Code: import std.stdio; import std.net.curl; void main() { writeln("hello world"); } Mon Feb 25 00:26:11 UTC 2013 x86_64 GNU/Linux curl is installed by apt-get install curl. Thanks!You have to link libcurl via argument: dmd hello.d -L-lcurl
Apr 26 2013
Thank you for answering. But it didnt work. I get: #dmd hello.d -L-lcurl /usr/bin/ld: cannot find -lcurl collect2: ld returned 1 exit status --- errorlevel 1 Curl is installed, as also libcurl3. I forget to mention that i am using "DMD64 D Compiler v2.062". Is std.net.curl working in this Version? Because it also didnt work on my Windows 7 System.
Apr 26 2013
On 04/26/2013 10:55 AM, mab wrote:Thank you for answering. But it didnt work. I get: #dmd hello.d -L-lcurl /usr/bin/ld: cannot find -lcurlTry providing the directory that the curl library file is in: #dmd hello.d -L-L/wherever/libcurl/is/in -L-lcurl Ali
Apr 26 2013
On 26/04/13 19:55, mab wrote:Thank you for answering. But it didnt work. I get: #dmd hello.d -L-lcurl /usr/bin/ld: cannot find -lcurl collect2: ld returned 1 exit status --- errorlevel 1 Curl is installed, as also libcurl3.You need to install the development curl package: $ sudo apt-get install libcurl4-openssl-dev or $ sudo apt-get install libcurl4-gnutls-dev or $ sudo apt-get install libcurl4-nss-devI forget to mention that i am using "DMD64 D Compiler v2.062". Is std.net.curl working in this Version? Because it also didnt work on my Windows 7 System.-- Jordi Sayol
Apr 26 2013
On Friday, 26 April 2013 at 18:14:04 UTC, Jordi Sayol wrote: [...]You need to install the development curl package: $ sudo apt-get install libcurl4-openssl-dev or $ sudo apt-get install libcurl4-gnutls-dev or $ sudo apt-get install libcurl4-nss-dev[...] That´s it. Thank you!
Apr 26 2013
On Friday, 26 April 2013 at 17:55:59 UTC, mab wrote:Thank you for answering. But it didnt work. I get: #dmd hello.d -L-lcurl /usr/bin/ld: cannot find -lcurl collect2: ld returned 1 exit status --- errorlevel 1 Curl is installed, as also libcurl3. I forget to mention that i am using "DMD64 D Compiler v2.062". Is std.net.curl working in this Version? Because it also didnt work on my Windows 7 System.Do you know what the libcurl library is actually called on your system? (try "find /usr -name "*curl*.so*" " or "find /usr -name "*curl*.a*" ) if the name you find is e.g. "libcurl3.so" then you'll have to use the linker flag -lcurl3 instead of lcurl p.s. Please don't be offended if you're already fully aware of this, it's just better to make sure the basics are covered first.
Apr 26 2013
On Fri, 26 Apr 2013 19:25:16 +0200, mab wrote:undefined reference to `curl_global_init' undefined reference to `curl_global_cleanup'These functions are defined in libcurl. Make sure you have installed libcurl if it wasn't installed as a dependency for curl.
Apr 26 2013