I'm familiar with C, but haven't written any medium or large application in it. I have a requirement to built an application that can be run as a standalone console application as well as Fast-CGI and Apache module.

I'm thinking of implementing the core functionality as a Static Library and then write a wrapper for console, Fast-CGI and Apache module.

As I'm not a C expert, I was wondering what are my other options. Having the core functionality in a standalone binary and calling it using system calls from the wrappers would work also, however I can't fully write down the pros and cons of each.

Also the software is supposed to run on GNU/Linux machines, so I'm very open to follow the community conventions.


The reason for using a dll is to ship changes to that dll only, the interface wrappers will be unchanged. YMMV if you ship all 3 components simultaneously, so building a static lib and shipping everything each time the code gets an update isn't a bad idea in that case.

You could also consider embedding a webserver (like mongoose or civetweb) in your application so the user can just start it up and get full web functionality without needing apache or fastcgi at all.


Why dont you write the core functionality as a dynamic link library in a sdk fashion with clear defined Interface for all the other components so you dont have to link the lib to each need ex. Console application etc.

  • Would this make the installation harder for the user, perhaps by requiring extra steps to set it properly? Besides that, my main argument could be that it will make the initialisation slightly slower -- specially in the Fast-CGI configuration, and perhaps there aren't any need for having it as a dynamic library rather static library, or are there? Would it save my development time if I go for a dynamic library? – Mahdi Dec 2 '15 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.