Compile c file in cgi-bin folder to use in web app


I’m trying to compile a c-file in a cgi-bin directory when creating an app. I need to have access via a web interface. The webserver starts and I can access the site, but I have some troubles getting the cgi script to work.
I would like to use c in my requests, but when I add the c-file (in the cgi-bin directory) to the sources (together with the default c file of the component to setup the component), it compiles it inside 1 file.

In the cgi-bin example in the wifi-ap, they use a shell script to execute the requests, but that is not an option in my case.

How can I compile the c-file in my cgi-bin folder and copy the result as executable cgi file in the cgi-bin directory.

I’m developing for a WP76xx

Thanks in advance