Problems with libcurl on Visual C++ Express Edition

Discussion in 'C++' started by borucik@gmail.com, Feb 12, 2007.

  1. Guest

    I am trying to use libcurl with Visual C++ 2005 Express Edition. I
    downloaded the file from here:
    http://curl.haxx.se/dlwiz/?type=lib&os=Win32&flav=-&ver=2000/XP
    It is the 7.16.0 version of the library. The 'lib' subdiretory
    contains following files:
    libcurl-4.dll
    libcurl.la
    libcurl.a
    libcurl.dll.a
    I added the 'include' subdirectory to the include path of the project
    (VS sees the 'curl.h' file) and the libcurl.dll.a to the Linker-
    >Additional Dependencies so that the linker does its job (with one

    warning however:
    Linking...
    libcurl.dll.a(d000116.o) : warning LNK4078: multiple '.text' sections
    found with different attributes (E0000020)
    My program is very simple, it goes like this:
    #include <code/code.h>
    #include <iostream>
    using namespace std;

    int main(){
    const char* url = "www.wp.pl";
    curl_global_init( CURL_GLOBAL_WIN32);
    CURL* context = curl_easy_init();
    if(context == NULL){
    cout << "Unable to initialize cURL interface" << endl;
    return -1;
    }
    curl_easy_setopt(context, CURLOPT_URL, url);
    curl_easy_setopt(context, CURLOPT_WRITEHEADER, stdout);
    curl_easy_setopt(context, CURLOPT_WRITEDATA, stdout);
    const CURLcode rc = curl_easy_perform(context);
    if( rc != CURLE_OK )
    cout << "Error performing" << endl;
    else{
    double statDouble;
    if( CURLE_OK == curl_easy_getinfo(context, CURLINFO_HTTP_CODE,
    &statLong))
    cout << "Response code: " << statLong << endl;
    }
    curl_easy_cleanup(context);
    curl_global_cleanup();
    return 0;
    }


    However, when I run the program it crashes without saying anything
    ('There was a problem with the application and it will be closed"). I
    figured that it appears along with the call of the function
    curl_global_init(). Any ideas on how to solve it? Thanks in advance.

    Przemek
     
    , Feb 12, 2007
    #1
    1. Advertising

  2. * :
    > I am trying to use libcurl with Visual C++ 2005 Express Edition. I
    > downloaded the file from here:
    > http://curl.haxx.se/dlwiz/?type=lib&os=Win32&flav=-&ver=2000/XP
    > It is the 7.16.0 version of the library. The 'lib' subdiretory
    > contains following files:
    > libcurl-4.dll
    > libcurl.la
    > libcurl.a
    > libcurl.dll.a
    > I added the 'include' subdirectory to the include path of the project
    > (VS sees the 'curl.h' file) and the libcurl.dll.a to the Linker-
    >> Additional Dependencies so that the linker does its job (with one

    > warning however:
    > Linking...
    > libcurl.dll.a(d000116.o) : warning LNK4078: multiple '.text' sections
    > found with different attributes (E0000020)


    [libcurl.dll.a] is probably a g++ import library. g++ uses the COFF
    format which also Visual C++ uses, so there is some shared ground, but
    the details are different. Ungood to mix. You need libraries built for
    Visual C++. C++ has no standard, common binary format.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Feb 13, 2007
    #2
    1. Advertising

  3. wrote:
    > I am trying to use libcurl with Visual C++ 2005 Express Edition. I
    > downloaded the file from here:
    > [..snip..]
    >
    > However, when I run the program it crashes without saying anything
    > ('There was a problem with the application and it will be closed"). I
    > figured that it appears along with the call of the function
    > curl_global_init(). Any ideas on how to solve it? Thanks in advance.


    Wrong newsgroup. C++ language does not define what 'libcurl' is or
    how to work with it. You probably need to contact the newsgroup
    where it would be on topic (the ng for your OS, maybe?)

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Feb 13, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. clintonG

    NEW: Visual C# Express Edition

    clintonG, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    571
    Cowboy \(Gregory A. Beamer\) [MVP]
    Jun 30, 2004
  2. bredal Jensen
    Replies:
    5
    Views:
    463
    bredal Jensen
    Jul 7, 2004
  3. Curt_C [MVP]
    Replies:
    6
    Views:
    358
    John Dalberg
    Aug 25, 2004
  4. John Dalberg
    Replies:
    6
    Views:
    591
  5. hunkgym
    Replies:
    1
    Views:
    1,988
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 30, 2006
Loading...

Share This Page