I have tried googling, and found no solution to my problem. I’m trying to learn how to use libcurl, a c networking library. I tried compiling a program that was automatically generated from curl, and a few examples i found online but nothing happened. I got no errors or logs, the program stopped “sucessfully” but i get no output. I also cant write to the console either while the library is included.

Any help is appreciated.

  • litchralee
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 days ago

    I’m on mobile so I can’t compile this myself, but can you clarify on what you’re observing? Does “nothing” mean no output to stdout and stderr? Or that you did get an error message but it’s not dispositive as to what libcurl was doing? Presumably the next step would be to validate that the program is executing at all, either with a debugger or printf-style debug statements at all junctures.

    Please include as much detail as you can, since this is now more akin to a bug report.

    EDIT: wait a sec. What exactly is this example code meant to do? The Pastebin API call suggests that this is meant to upload a payload to the web, not pull it down. But CURLOPT_WRITEFUNCTION is for receiving data from a URI. What is your intention with running this example program?

    • Irelephant@lemm.eeOP
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      I’m trying to send a post request to Pastebins api to make a paste. This is one of the first programs I have tried to write with libcurl, so its probably wrong.