-8

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.

you are viewing a single comment's thread
view the rest of the comments
[-] litchralee@sh.itjust.works 2 points 3 weeks ago* (last edited 3 weeks 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.ee 1 points 3 weeks 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.

this post was submitted on 29 Nov 2024
-8 points (25.0% liked)

Programming

17672 readers
36 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS