Results 1 to 2 of 2

Thread: Codeblocks c++ linking curl lib ?

  1. #1
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

    Codeblocks c++ linking curl lib ?

    I have a very basic curl program to display a google web page.
    Code:
    /***************************************************************************
     * Project CURL
     * ORIGANL AOURTER, Daniel Stenberg, <daniel@haxx.se>, et al.
     * EDITED: highspdier
     ***************************************************************************/
    #include <stdio.h>
    #include <curl/curl.h>
    #include <iostream>
    using namespace std;
    
    int main(void)
    {
      CURL *curl;
      CURLcode res;
    
      curl = curl_easy_init();
      if(curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
        res = curl_easy_perform(curl);
    
        cout << res;
        /* always cleanup */
        curl_easy_cleanup(curl);
      }
      return 0;
    }
    I CAN build the main from commandline it works 100%
    Code:
    g++ -lcurl main.cpp -o build
    But have no idea how to link the library or do what ever it is i need to do to make it work inside code blocks.
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

  2. #2
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    151
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Codeblocks c++ linking curl lib ?

    Solved-


    opened code blocks. settings->complier - debugging settinges->
    selected the the tab "Linker settings" went to add

    /usr/lib/libcurl-gnutls.so.4.2.0

    done
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

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
  •