Results 1 to 3 of 3

Thread: CURL in D (Seg fault)

  1. #1
    Join Date
    May 2011
    Beans
    273

    CURL in D (Seg fault)

    Hi everyone!

    I just started using the curl library and have no idea why this code is seg faulting. It is in D programming language.

    PHP Code:
    #!/usr/bin/rdmd -w
    import std.stdio;
    import etc.c.curl;

    int main()
    {
        
    curl_global_init(CurlGlobal.all);
        
    auto easy_handle curl_easy_init();
        
        
    curl_easy_setopt(easy_handleCurlOption.url"http://24ur.com"); //SEG FAULT
        
        
    curl_easy_cleanup(easy_handle);
        
    curl_global_cleanup();
        return 
    0;

    It segfaults in line with curl_easy_setopt(...). Anyone knows why that might be happening?

    Thanks in advance!
    Your left hand is touching your face.

  2. #2
    Join Date
    Oct 2009
    Beans
    7

    Re: CURL in D (Seg fault)

    Hi,

    Can you tell us what compiler are you using and which version ?

    As far as I know gdc in ubuntu's repository is broken. I don't jnow if it has been fixed in recent version of ubuntu.

    You can use dmd, the last version is 2.057 . You can also compile gdc by yourself as mentionned here : https://bitbucket.org/goshawk/gdc/wiki/Home (but you'll have D version 2.055, the main changement is about inout : http://drdobbs.com/blogs/cpp/231902461 ).

    I can't help you that much without more details.

  3. #3
    Join Date
    May 2011
    Beans
    273

    Re: CURL in D (Seg fault)

    Quote Originally Posted by deadalnix View Post
    Hi,

    Can you tell us what compiler are you using and which version ?

    As far as I know gdc in ubuntu's repository is broken. I don't jnow if it has been fixed in recent version of ubuntu.

    You can use dmd, the last version is 2.057 . You can also compile gdc by yourself as mentionned here : https://bitbucket.org/goshawk/gdc/wiki/Home (but you'll have D version 2.055, the main changement is about inout : http://drdobbs.com/blogs/cpp/231902461 ).

    I can't help you that much without more details.
    I use dmd. But that's old problem and I used curl for D this time. Will mark it as solved, but thanks for help anyway!
    Your left hand is touching your face.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •