title: C++ cross-platform dynamic libraries for Linux and Windows
body: <p>I am wanting to write some cross-platform library code.</p>
  <p>I am creating a library both static and dynamic with most of the development done in Linux, I have got the static and shared library generated in Linux but now wanted to generate a Windows version of a static and dynamic library in the form of <code>.lib</code> and <code>.dll</code> using the same source code.</p>
  <p>Is this possible? I'm a bit worried because I noticed generating Windows <code>.dll</code> files required using <code>_dllspec</code> or something similiar in your source code.</p>
  <p>I am seeking the best and quickest solution to getting my code compiled on Windows. I don't need to do the compiling under Linux; I am happy to do it directly under Windows. Also I am using two external libraries which are Boost and Xerces XML which I have installed on both my Windows and Linux system so hopefully they shouldn't be a problem.</p>
  <p>What I really want is to have a single source code copy that can be compiled under both Linux and Windows to generate libraries specific to each platform. I don't really care if I have to edit my code in favour of Windows or Linux as long as I can have a single source code copy.</p>