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.

Thanks in advance

Hi ,

You case you have compiled cScriptFile(c-file)as Legato C application (where you add it to Component.cdef).
instead
Can you try to cross compile cScriptFile(c-file) as normal C application .You can refer to the below link on how to cross compile
https://docs.legato.io/latest/howToPortLegacyC.html

And later bundle cScriptFile.exe it into cgi-bin directory using “bundles” syntax in “.adef” file and let me know the behaviour.
bundles:
{
file:
{
[x] cScriptFile.exe> /cgi-bin/cScriptFile.exe
}
}

Regards,
Vasantha