Creating an Executable
The CCompilerDriver package lets you work with C compilers that are installed on your computer. It is used automatically by the Wolfram System compiler when you set the option CompilationTarget to "C", but you can use it to build your own executables, libraries, and object files from source code written in the C language.
First, the packages are loaded.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-bgbewh
This creates a basic C function.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-g8ywdz

This compiles the code into an executable.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-6teck

If the input came from one or more files of C code, these could be given to CreateExecutable in a list.
The extension for the generated executable is added to be compatible with the system.
If an input file is given that has an extension of .tm, CreateExecutable will treat it as a Wolfram Symbolic Transfer Protocol (WSTP) template file and use wsprep to process it.
More information on options and settings is found in the section on Configuring the Compilation.
WSTP Executables
WSTP is the Wolfram Language's unique high-level symbolic interface standard for interprogram communication. The CCompilerDriver package is useful for working with WSTP since you can build WSTP programs from within the Wolfram Language. One particularly useful feature is that if an input file is given with an extension of .tm, CreateExecutable will treat this as a WSTP template file and use wsprep to process it.
The WSTP developer kit that ships with the Wolfram Language contains a number of examples. The location for these is as follows.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-nnqsab
This finds the addtwo sample source files.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-cdugyh
Now you can build these with the CCompilerDriver package; first you have to load it.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-cbf55e
This sets appropriate options for compiling C++ source files and for linking with WSTP.

https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-clp1sf


https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-f2x225


https://wolfram.com/xid/0bgqkeyjhd3rr06z0moibhej6j4lny-dczkyk

More information is found in the WSTP documentation.