www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Curl Module Error

reply "Ali" <goren.ali yandex.com> writes:
I get an error message when trying to curl

Error output:


a.d:2: Error: module curl is in file 'std/net/curl.d' which 
cannot be read
import path[0] = /usr/include/d2/4.6/i486-linux-gnu
import path[1] = /usr/include/d2/4.6

My Code:

import std.net.curl;
import std.stdio;

int main()
{
	string content = post("examplesite.org");
	
}

How can I solve this problem?

Sorry for my bad english.
Jul 11 2013
parent reply Johannes Pfau <nospam example.com> writes:
Am Thu, 11 Jul 2013 15:29:09 +0200
schrieb "Ali" <goren.ali yandex.com>:

 /usr/include/d2/4.6
This looks like you're using a very old gdc version. std.net.curl was added in 2.058.
Jul 11 2013
parent reply "Ali" <goren.ali yandex.com> writes:
On Thursday, 11 July 2013 at 13:46:48 UTC, Johannes Pfau wrote:
 Am Thu, 11 Jul 2013 15:29:09 +0200
 schrieb "Ali" <goren.ali yandex.com>:

 /usr/include/d2/4.6
This looks like you're using a very old gdc version. std.net.curl was added in 2.058.
How do I update? Searched, but could not find it. Because English is not enough.
Jul 11 2013
parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Jul 11, 2013 at 04:36:42PM +0200, Ali wrote:
 On Thursday, 11 July 2013 at 13:46:48 UTC, Johannes Pfau wrote:
Am Thu, 11 Jul 2013 15:29:09 +0200
schrieb "Ali" <goren.ali yandex.com>:

/usr/include/d2/4.6
This looks like you're using a very old gdc version. std.net.curl was added in 2.058.
How do I update? Searched, but could not find it. Because English is not enough.
gdc-4.8 is now available in Debian and a few other distros. You should be able to just update it if you use one of these distros; if not, try compiling from source (see the d.gnu forum, there's a recent thread that has explicit steps of how to get the build to work properly). T -- Three out of two people have difficulties with fractions. -- Dirk Eddelbuettel
Jul 11 2013
parent reply "Ali" <goren.ali yandex.com> writes:
On Thursday, 11 July 2013 at 14:44:23 UTC, H. S. Teoh wrote:
 On Thu, Jul 11, 2013 at 04:36:42PM +0200, Ali wrote:
 On Thursday, 11 July 2013 at 13:46:48 UTC, Johannes Pfau wrote:
Am Thu, 11 Jul 2013 15:29:09 +0200
schrieb "Ali" <goren.ali yandex.com>:

/usr/include/d2/4.6
This looks like you're using a very old gdc version. std.net.curl was added in 2.058.
How do I update? Searched, but could not find it. Because English is not enough.
gdc-4.8 is now available in Debian and a few other distros. You should be able to just update it if you use one of these distros; if not, try compiling from source (see the d.gnu forum, there's a recent thread that has explicit steps of how to get the build to work properly). T
My gdc --version output gdc (Debian 4.6.3-2) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. how to update? my distro name is kali linux based on debian Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Jul 11 2013
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Jul 11, 2013 at 05:38:16PM +0200, Ali wrote:
 On Thursday, 11 July 2013 at 14:44:23 UTC, H. S. Teoh wrote:
[...]
gdc-4.8 is now available in Debian and a few other distros. You
should be able to just update it if you use one of these distros; if
not, try compiling from source (see the d.gnu forum, there's a recent
thread that has explicit steps of how to get the build to work
properly).
[...]
 My gdc --version output
 

 gdc (Debian 4.6.3-2) 4.6.3
 Copyright (C) 2011 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There
 is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.
 
 how to update?
 
 my distro name is kali linux based on debian
 

 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Hmm. gdc-4.8 *is* rather recent, so maybe it hasn't percolated down to your distro yet. The first release of gdc-4.8 (AFAICT) was 03 Jun 2013 (4.8.1-1). The latest release is 4.8.1-6 (09 Jul 2013). You could add the 'unstable' branch to /etc/apt/sources.list to pull it in, probably, i.e.: deb http://ftp.debian.org/debian unstable main contrib Not sure how it would interact with the rest of your distro though. It may be safer to try adding 'unstable' to your existing 'deb' line that points to your distro's FTP servers; they may have synced with the main Debian archive recently enough to have picked up gdc-4.8. Alternatively, if it ends up being a mess, you could download the .deb's directly from the Debian FTP archive: http://ftp.debian.org/debian/pool/main/g/gcc-4.8/gdc-4.8_4.8.1-6_amd64.deb Replace "amd64" with your architecture. The downside of this approach is that you'll have to hunt down all the dependencies manually, and there can be a lot of them for gdc. It *could* actually be easier for you to build GDC yourself; for this, check the recent thread in the d.gnu forum for explicit instructions (make sure you follow each step carefully, as a broken GCC/GDC build can be a hair-tearing frustrating experience -- speaking from experience). If you run into trouble, ask on the forum there and we'll try to help you. :) T -- Creativity is not an excuse for sloppiness.
Jul 11 2013