xref: /curl/docs/examples/README.md (revision 3040971d)
1<!--
2Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3
4SPDX-License-Identifier: curl
5-->
6
7# libcurl examples
8
9This directory is for libcurl programming examples. They are meant to show
10some simple steps on how you can build your own application to take full
11advantage of libcurl.
12
13If you end up with other small but still useful example sources, please mail
14them for submission in future packages and on the website.
15
16## Building
17
18The `Makefile.example` is an example Makefile that could be used to build
19these examples. Just edit the file according to your system and requirements
20first.
21
22Most examples should build fine using a command line like this:
23
24    `curl-config --cc --cflags --libs` -o example-my example.c
25
26Some compilers do not like having the arguments in this order but instead
27want you do reorganize them like:
28
29    `curl-config --cc` -o example-my example.c `curl-config --cflags --libs`
30
31**Please** do not use the `curl.se` site as a test target for your libcurl
32applications/experiments. Even if some of the examples use that site as a URL
33at some places, it does not mean that the URLs work or that we expect you to
34actually torture our website with your tests. Thanks.
35
36## Examples
37
38Each example source code file is designed to be and work stand-alone and
39rather self-explanatory. The examples may at times lack the level of error
40checks you need in a real world, but that is then only for the sake of
41readability: to make the code smaller and easier to follow.
42