At link time, you will also need to include quite a few libraries in order to utilize the protocols Oracle requires for communications. These libraries add at least 2 megabytes to the compiled executable. CGI programming requires that you adapt to a static environment. An HTML form accepts input, and a CGI binary is launched to take the input, query the database, and produce some output. The CGI binary must complete execution at the end of each process.
Some projects are multi-stage, where multiple forms are needed, and multiple CGI calls are required.
Unfortunately, students think they need to compile a separate executable for each of these CGI phases, or steps. This is not true, and is a waste of disk space. Your goal is to keep your program efficient, and keeping the size of your entire project under 5 megabytes is very easy to do. The switch statement determines which stage of the program it is in, and passes control to an appropriate function. In your CGI executable, you must have some processing stage in which you extract the inputs from the HTML form.