I figured out with the help of @KliPPy how to compile. However, the output is a .exe instead of .dll. How to configure Visual Studio to output a .DLL file, instead of a .exe. Also, it asks for making a main function, which is not needed in the case. Got to know it would be not needed if I compile as a .DLL ?