diff --git a/Core/Algorithms/inc/Beam.h b/Core/Algorithms/inc/Beam.h
index 66e4b8870d7aa469cd2a92ea79baa51ce00892eb..0630f523bed3dde99aa643103a45335ca506a1b6 100644
--- a/Core/Algorithms/inc/Beam.h
+++ b/Core/Algorithms/inc/Beam.h
@@ -16,12 +16,13 @@
 #ifndef BEAM_H_
 #define BEAM_H_
 
+#include "WinDllMacros.h"
 #include "Types.h"
 #include "IParameterized.h"
 
 //! Ideal collimated Beam defined by wavelength, direction and intensity.
 
-class Beam : public IParameterized
+class BA_CORE_API_ Beam : public IParameterized
 {
  public:
     Beam();
diff --git a/Core/Algorithms/inc/ChiSquaredModule.h b/Core/Algorithms/inc/ChiSquaredModule.h
index 07bcbfc416bda71cb1bc61dd8e49cd02afde0b5c..f723a2e860006a8a12af8a51d82e63a606b9d68c 100644
--- a/Core/Algorithms/inc/ChiSquaredModule.h
+++ b/Core/Algorithms/inc/ChiSquaredModule.h
@@ -16,9 +16,10 @@
 #ifndef CHISQUAREDMODULE_H_
 #define CHISQUAREDMODULE_H_
 
+#include "WinDllMacros.h"
 #include "IChiSquaredModule.h"
 
-class ChiSquaredModule : public IChiSquaredModule
+class BA_CORE_API_ ChiSquaredModule : public IChiSquaredModule
 {
  public:
     ChiSquaredModule() {}
diff --git a/Core/Algorithms/inc/ConvolutionDetectorResolution.h b/Core/Algorithms/inc/ConvolutionDetectorResolution.h
index e562e6f3e9b6ed2292c5fd434c6b23e2a77f2ded..5a208dc977f6e64cd71b1e7c1c97866856f9423b 100644
--- a/Core/Algorithms/inc/ConvolutionDetectorResolution.h
+++ b/Core/Algorithms/inc/ConvolutionDetectorResolution.h
@@ -16,6 +16,7 @@
 #ifndef CONVOLUTIONDETECTORRESOLUTION_H_
 #define CONVOLUTIONDETECTORRESOLUTION_H_
 
+#include "WinDllMacros.h"
 #include "IDetectorResolution.h"
 #include "IResolutionFunction2D.h"
 
@@ -24,7 +25,7 @@
 //! Limitation: this class assumes that the data points are evenly
 //! distributed on each axis
 
-class ConvolutionDetectorResolution : public IDetectorResolution
+class BA_CORE_API_ ConvolutionDetectorResolution : public IDetectorResolution
 {
  public:
     typedef double (*cumulative_DF_1d)(double);
diff --git a/Core/Algorithms/inc/Detector.h b/Core/Algorithms/inc/Detector.h
index 077c585eb26c13cc3ad9b46d52df60f0e727252e..020bfa10aca5a1eb92db016e1b0e637444603590 100644
--- a/Core/Algorithms/inc/Detector.h
+++ b/Core/Algorithms/inc/Detector.h
@@ -16,13 +16,14 @@
 #ifndef DETECTOR_H_
 #define DETECTOR_H_
 
+#include "WinDllMacros.h"
 #include "IDetectorResolution.h"
 #include "DetectorParameters.h"
 #include "SafePointerVector.h"
 
 //! Detector with axes and resolution function.
 
-class Detector : public IParameterized
+class BA_CORE_API_ Detector : public IParameterized
 {
  public:
 
diff --git a/Core/Algorithms/inc/IChiSquaredModule.h b/Core/Algorithms/inc/IChiSquaredModule.h
index 93d4e5e99e7322e8180253a0319bcf908c19a4c4..fcd071dc378ff41f03495d97549a5520cb81527d 100644
--- a/Core/Algorithms/inc/IChiSquaredModule.h
+++ b/Core/Algorithms/inc/IChiSquaredModule.h
@@ -16,6 +16,7 @@
 #ifndef ICHISQUAREDMODULE_H_
 #define ICHISQUAREDMODULE_H_
 
+#include "WinDllMacros.h"
 #include "IFittingDataSelector.h"
 #include "ISquaredFunction.h"
 #include "IOutputDataNormalizer.h"
@@ -23,7 +24,7 @@
 
 //! Interface for ChiSquaredModule, ChiSquaredFrequency.
 
-class IChiSquaredModule : public ICloneable
+class BA_CORE_API_ IChiSquaredModule : public ICloneable
 {
  public:
     IChiSquaredModule();
diff --git a/Core/Algorithms/inc/IOutputDataNormalizer.h b/Core/Algorithms/inc/IOutputDataNormalizer.h
index 271537bb1dfb7c63b7f7efa680cdd58d5b845383..5b88292f4693d8fb9b3423f9e1b2940bbd235bb3 100644
--- a/Core/Algorithms/inc/IOutputDataNormalizer.h
+++ b/Core/Algorithms/inc/IOutputDataNormalizer.h
@@ -17,6 +17,7 @@
 #ifndef IOUTPUTDATANORMALIZER_H
 #define IOUTPUTDATANORMALIZER_H
 
+#include "WinDllMacros.h"
 #include "IParameterized.h"
 #include "OutputData.h"
 
@@ -37,7 +38,7 @@ class IOutputDataNormalizer : public IParameterized
 
 //! Standard OutputData normalizer, with configurable max_intensity.
 
-class OutputDataNormalizer : public IOutputDataNormalizer
+class BA_CORE_API_ OutputDataNormalizer : public IOutputDataNormalizer
 {
  public:
     OutputDataNormalizer(double scale=1.0, double shift=0.0)
diff --git a/Core/Algorithms/inc/Instrument.h b/Core/Algorithms/inc/Instrument.h
index 446329283bd7a57d2f87fbcc8ff2d9ee32ad4163..9f829138214001bb1b1220cc3bd09c682b6da039 100644
--- a/Core/Algorithms/inc/Instrument.h
+++ b/Core/Algorithms/inc/Instrument.h
@@ -16,13 +16,14 @@
 #ifndef INSTRUMENT_H_
 #define INSTRUMENT_H_
 
+#include "WinDllMacros.h"
 #include "Beam.h"
 #include "Detector.h"
 #include "IResolutionFunction2D.h"
 
 //! Assembles beam, detector and their relative positions wrt the sample.
 
-class Instrument : public IParameterized
+class BA_CORE_API_ Instrument : public IParameterized
 {
  public:
     Instrument();
diff --git a/Core/Algorithms/inc/Mask.h b/Core/Algorithms/inc/Mask.h
index 5765a0b6b98290c0905920756cd473ed8026af7f..062f20396acc37fc9b2f1a67bba5eb3b070c3049 100644
--- a/Core/Algorithms/inc/Mask.h
+++ b/Core/Algorithms/inc/Mask.h
@@ -16,11 +16,12 @@
 #ifndef MASK_H_
 #define MASK_H_
 
+#include "WinDllMacros.h"
 #include "MaskCoordinateFunction.h"
 
 //! Base class for masking OutputData elements.
 
-class Mask : public ICloneable
+class BA_CORE_API_ Mask : public ICloneable
 {
  public:
     template <class TValue, class TContainer> friend class OutputDataIterator;
@@ -48,7 +49,7 @@ class Mask : public ICloneable
 
 //! Mask based on the index modulo a given number.
 
-class MaskIndexModulus : public Mask
+class BA_CORE_API_ MaskIndexModulus : public Mask
 {
  public:
     MaskIndexModulus(size_t modulus, size_t remainder, Mask *p_submask=0)
@@ -66,7 +67,7 @@ class MaskIndexModulus : public Mask
 
 //! Mask based on the coordinates.
 
-class MaskCoordinates : public Mask
+class BA_CORE_API_ MaskCoordinates : public Mask
 {
  public:
     MaskCoordinates(size_t rank, const int *dims, Mask *p_submask=0);
diff --git a/Core/Algorithms/inc/MaskCoordinateFunction.h b/Core/Algorithms/inc/MaskCoordinateFunction.h
index d27d0c0afb49a6c84ad99cc586305d9a55a6eb1b..50412bac1ee3e22872ca7b7838c0daa4e98dcdd2 100644
--- a/Core/Algorithms/inc/MaskCoordinateFunction.h
+++ b/Core/Algorithms/inc/MaskCoordinateFunction.h
@@ -17,6 +17,7 @@
 #ifndef MASKCOORDINATEFUNCTION_H_
 #define MASKCOORDINATEFUNCTION_H_
 
+#include "WinDllMacros.h"
 #include <cstddef>
 #include "ICloneable.h"
 
@@ -39,7 +40,7 @@ class MaskCoordinateFunction : public ICloneable
 
 //! ?
 
-class MaskCoordinateRectangleFunction : public MaskCoordinateFunction
+class BA_CORE_API_ MaskCoordinateRectangleFunction : public MaskCoordinateFunction
 {
  public:
     MaskCoordinateRectangleFunction(size_t rank, const int *minima, const int *maxima);
@@ -56,7 +57,7 @@ class MaskCoordinateRectangleFunction : public MaskCoordinateFunction
 
 //! ?
 
-class MaskCoordinateEllipseFunction : public MaskCoordinateFunction
+class BA_CORE_API_ MaskCoordinateEllipseFunction : public MaskCoordinateFunction
 {
  public:
     MaskCoordinateEllipseFunction(size_t rank, const int *center, const int *radii);
diff --git a/Core/Algorithms/inc/ResolutionFunction2DSimple.h b/Core/Algorithms/inc/ResolutionFunction2DSimple.h
index 689589292233429fa0480024dc94b9e27b09e5b2..f16a95c070f869914cae38e86deded8d9657d309 100644
--- a/Core/Algorithms/inc/ResolutionFunction2DSimple.h
+++ b/Core/Algorithms/inc/ResolutionFunction2DSimple.h
@@ -16,11 +16,12 @@
 #ifndef RESOLUTIONFUNCTION2DSIMPLE_H_
 #define RESOLUTIONFUNCTION2DSIMPLE_H_
 
+#include "WinDllMacros.h"
 #include "IResolutionFunction2D.h"
 
 //! ?
 
-class ResolutionFunction2DSimple : public IResolutionFunction2D
+class BA_CORE_API_ ResolutionFunction2DSimple : public IResolutionFunction2D
 {
  public:
     ResolutionFunction2DSimple(double sigma_x, double sigma_y);
diff --git a/Core/Algorithms/inc/Simulation.h b/Core/Algorithms/inc/Simulation.h
index 3c472555f8cae5bb7562b2e988f713a61753cf92..c933e0b9bbd674545d727975e02a58c28a831dba 100644
--- a/Core/Algorithms/inc/Simulation.h
+++ b/Core/Algorithms/inc/Simulation.h
@@ -16,6 +16,7 @@
 #ifndef SIMULATION_H_
 #define SIMULATION_H_
 
+#include "WinDllMacros.h"
 #include "ISampleBuilder.h"
 #include "Instrument.h"
 #include "SimulationParameters.h"
@@ -24,7 +25,7 @@ class ProgramOptions;
 
 //! Run one simulation.
 
-class Simulation : public IParameterized, public ICloneable
+class BA_CORE_API_ Simulation : public IParameterized, public ICloneable
 {
  public:
     Simulation();
diff --git a/Core/Core.pro b/Core/Core.pro
index 05704219c0e3179e69e8803fce05c44c670c9841..036dba552c59191f2cf946fc02033bd60604da86 100644
--- a/Core/Core.pro
+++ b/Core/Core.pro
@@ -316,11 +316,12 @@ HEADERS += \
     Fitting/inc/IMinimizer.h \
     Fitting/inc/MinimizerScan.h \
     Fitting/inc/MinimizerTest.h \
+    \
     StandardSamples/SampleBuilderFactory.h \
     StandardSamples/IsGISAXS01Builder.h \
     Tools/inc/SamplePrintVisitor.h \
-    StandardSamples/IsGISAXS04Builder.h
-
+    Tools/inc/WinDllMacros.h \
+    StandardSamples/IsGISAXS04Builder.h \
 
 contains(CONFIG, BORNAGAIN_PYTHON) {
    include($$PWD/python_module.pri)
@@ -336,6 +337,9 @@ macx {
 unix:!macx {
     DEFINES += Q_OS_LINUX
 }
+win32 {
+    DEFINES += BA_CORE_BUILD_DLL
+}
 
 CONFIG(debug, debug|release) {
     QMAKE_CXXFLAGS_DEBUG += -DDEBUG_FPE
diff --git a/Core/FormFactors/inc/FormFactorCylinder.h b/Core/FormFactors/inc/FormFactorCylinder.h
index 13f081fe26e19dfe030e9f675c774c9922820c83..524ca416178b2638b3f7dd25ca9394435f8865ec 100644
--- a/Core/FormFactors/inc/FormFactorCylinder.h
+++ b/Core/FormFactors/inc/FormFactorCylinder.h
@@ -20,7 +20,7 @@
 
 //! Form factor of a cylinder.
 
-class FormFactorCylinder : public IFormFactorBorn
+class BA_CORE_API_ FormFactorCylinder : public IFormFactorBorn
 {
  public:
     FormFactorCylinder(double height, double radius);
diff --git a/Core/FormFactors/inc/FormFactorPrism3.h b/Core/FormFactors/inc/FormFactorPrism3.h
index 2ab9256b12719e47ebc833921ac33a9c72ef697f..485b1e6a3d2b866c10395c22947d56dca51b37e5 100644
--- a/Core/FormFactors/inc/FormFactorPrism3.h
+++ b/Core/FormFactors/inc/FormFactorPrism3.h
@@ -21,7 +21,7 @@
 
 //! Formfactor of a prism based on a regular triangle.
 
-class FormFactorPrism3 : public IFormFactorBorn
+class BA_CORE_API_ FormFactorPrism3 : public IFormFactorBorn
 {
  public:
     FormFactorPrism3(double height, double half_side);
diff --git a/Core/FormFactors/inc/IFormFactor.h b/Core/FormFactors/inc/IFormFactor.h
index f713882a588e79e6c75f8a148e6c11dfdbd594fc..da4dc030aaa720b063e66c39e5a510264f9d8e64 100644
--- a/Core/FormFactors/inc/IFormFactor.h
+++ b/Core/FormFactors/inc/IFormFactor.h
@@ -17,12 +17,13 @@
 #ifndef IFORMFACTOR_H
 #define IFORMFACTOR_H
 
+#include "WinDllMacros.h"
 #include "ISample.h"
 #include "Bin.h"
 
 //! The basic interface for formfactors.
 
-class IFormFactor : public ISample
+class BA_CORE_API_ IFormFactor : public ISample
 {
  public:
     IFormFactor() {}
diff --git a/Core/FormFactors/inc/IFormFactorBorn.h b/Core/FormFactors/inc/IFormFactorBorn.h
index d41d04ca4b9477d10351c989e8f3f93b19476c93..c1f0dbe5826c5826ecd1713d0121d56470c0c232 100644
--- a/Core/FormFactors/inc/IFormFactorBorn.h
+++ b/Core/FormFactors/inc/IFormFactorBorn.h
@@ -20,7 +20,7 @@
 
 //! Pure virtual interface for Born formfactors (only depending on q=ki-kf).
 
-class IFormFactorBorn : public IFormFactor
+class BA_CORE_API_ IFormFactorBorn : public IFormFactor
 {
  public:
     IFormFactorBorn() {}
diff --git a/Core/Geometry/inc/BasicVector3D.h b/Core/Geometry/inc/BasicVector3D.h
index ba62aa2d961c5eefc6b292433aa65af0d58d966b..eb23955cd2bf12b63a46db98d874e4c7df65c1e2 100644
--- a/Core/Geometry/inc/BasicVector3D.h
+++ b/Core/Geometry/inc/BasicVector3D.h
@@ -23,6 +23,7 @@
 
 #include "Numeric.h"
 #include "Exceptions.h"
+#include "WinDllMacros.h"
 #include <complex>
 
 namespace Geometry {
@@ -328,12 +329,27 @@ inline bool
 operator!=(const BasicVector3D<T>& a, const BasicVector3D<T>& b)
 { return (a.x()!=b.x() || a.y()!=b.y() || a.z()!=b.z()); }
 
-template<> std::complex<double> BasicVector3D<std::complex<double> >::dot(
+template<> BA_CORE_API_ double BasicVector3D<double>::mag2() const;
+
+template<> BA_CORE_API_ double BasicVector3D<double>::mag() const;
+
+template<> BA_CORE_API_ double BasicVector3D<double>::magxy2() const;
+
+template<> BA_CORE_API_ double BasicVector3D<double>::magxy() const;
+
+template<> BA_CORE_API_ std::complex<double>
+        BasicVector3D<std::complex<double> >::magxy() const;
+
+template<> BA_CORE_API_ std::complex<double> BasicVector3D<std::complex<double> >::dot(
         const BasicVector3D<std::complex<double> >& v) const;
 
-template<> double BasicVector3D<double>::dot(
+template<> BA_CORE_API_ double BasicVector3D<double>::dot(
+        const BasicVector3D<double>& v) const;
+
+template<> BA_CORE_API_ BasicVector3D<double> BasicVector3D<double>::cross(
         const BasicVector3D<double>& v) const;
 
+
 }  // namespace Geometry
 
 #endif /* GEOMETRY_BASICVECTOR3D_H */
diff --git a/Core/Geometry/src/BasicVector3D.cpp b/Core/Geometry/src/BasicVector3D.cpp
index 39e2bca24d251a3ad4990fdb1b2c730362163b25..e7eee932ddeedad0f401f25a6b14d6d2862a62d4 100644
--- a/Core/Geometry/src/BasicVector3D.cpp
+++ b/Core/Geometry/src/BasicVector3D.cpp
@@ -135,8 +135,8 @@ double BasicVector3D<double>::dot(const BasicVector3D<double>& v) const
 }
 
  //! Returns cross product of vectors
- template<>
- BasicVector3D<double> BasicVector3D<double>::cross(
+template<>
+BasicVector3D<double> BasicVector3D<double>::cross(
     const BasicVector3D<double>& v) const
 {
     return BasicVector3D<double>(y()*v.z()-v.y()*z(),
diff --git a/Core/PythonAPI/inc/PythonListConverter.h b/Core/PythonAPI/inc/PythonListConverter.h
index 6aa67a503c5f3611e9bb68f9e8f489608e0e15fe..f229282d4c585f01047dc845123ed05c4f9a26b8 100644
--- a/Core/PythonAPI/inc/PythonListConverter.h
+++ b/Core/PythonAPI/inc/PythonListConverter.h
@@ -17,7 +17,7 @@
 #define PYTHONLISTCONVERTER_H
 
 
-#include "Python.h"
+#include "boost/python/detail/wrap_python.hpp"
 
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
diff --git a/Core/PythonAPI/src/PythonModule.cpp b/Core/PythonAPI/src/PythonModule.cpp
index cec7102d16eedc96c258ca222e187de0cce971e8..a9c9a94a453aafdc9704a3295684a00dc66f3eaf 100644
--- a/Core/PythonAPI/src/PythonModule.cpp
+++ b/Core/PythonAPI/src/PythonModule.cpp
@@ -1,4 +1,4 @@
-#include "Python.h"
+#include "boost/python/detail/wrap_python.hpp"
 #define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY 
 #include "numpy/arrayobject.h"
 // the order of 3 guys above is important
diff --git a/Core/PythonAPI/src/PythonOutputData.cpp b/Core/PythonAPI/src/PythonOutputData.cpp
index 59699a48f80f022c0b3ff2cb1eabe9218b320f18..3edece32f42d9877819c1c586a9a1513eff0c389 100644
--- a/Core/PythonAPI/src/PythonOutputData.cpp
+++ b/Core/PythonAPI/src/PythonOutputData.cpp
@@ -14,7 +14,7 @@
 //
 // ************************************************************************** //
 
-#include "Python.h"
+#include "boost/python/detail/wrap_python.hpp"
 #define PY_ARRAY_UNIQUE_SYMBOL BORNAGAIN_PYTHONAPI_ARRAY
 #define NO_IMPORT_ARRAY
 #include "numpy/arrayobject.h"
diff --git a/Core/Samples/inc/ICompositeSample.h b/Core/Samples/inc/ICompositeSample.h
index 563aa097fdd11d9f8a4374ee2cab458781613ac4..173a24ee782e0d1f1452c0794fadd3790256b007 100644
--- a/Core/Samples/inc/ICompositeSample.h
+++ b/Core/Samples/inc/ICompositeSample.h
@@ -16,6 +16,7 @@
 #ifndef ICOMPOSITESAMPLE_H
 #define ICOMPOSITESAMPLE_H
 
+#include "WinDllMacros.h"
 #include "ISample.h"
 #include <list>
 
@@ -38,7 +39,7 @@
 //!   - DiffuseParticleInfo
 //!   - PositionParticleInfo
 //!
-class ICompositeSample : public ISample
+class BA_CORE_API_ ICompositeSample : public ISample
 {
  public:
     ICompositeSample() {}
diff --git a/Core/Samples/inc/ISample.h b/Core/Samples/inc/ISample.h
index 46cbaf96f5cc6e903b7d3776cea0e6b9fb04ce77..c2bdf78b8099df0c24afdbf65a05c0e501f2198c 100644
--- a/Core/Samples/inc/ISample.h
+++ b/Core/Samples/inc/ISample.h
@@ -16,6 +16,7 @@
 #ifndef ISAMPLE_H
 #define ISAMPLE_H
 
+#include "WinDllMacros.h"
 #include "IParameterized.h"
 #include "ICloneable.h"
 #include "ISampleVisitor.h"
@@ -25,7 +26,7 @@ class DWBASimulation;
 
 //! Interface for objects related to scattering
 
-class ISample : public IParameterized, public ICloneable
+class BA_CORE_API_ ISample : public IParameterized, public ICloneable
 {
  public:
     ISample() { setName("ISample"); }
diff --git a/Core/Samples/inc/Layer.h b/Core/Samples/inc/Layer.h
index 0c9764ba1b292bb3310e1efe499ecf1c929b4a7b..9e3d958d9d75b4b9bbcc83633debea3e76eedafe 100644
--- a/Core/Samples/inc/Layer.h
+++ b/Core/Samples/inc/Layer.h
@@ -16,6 +16,7 @@
 #ifndef LAYER_H
 #define LAYER_H
 
+#include "WinDllMacros.h"
 #include "ICompositeSample.h"
 #include "IMaterial.h"
 #include "HomogeneousMaterial.h"
@@ -23,7 +24,7 @@
 
 //! A Layer with thickness and pointer to the material
 
-class Layer : public ICompositeSample
+class BA_CORE_API_ Layer : public ICompositeSample
 {
  public:
     //! Constructs empty layer.
diff --git a/Core/Samples/inc/LayerDecorator.h b/Core/Samples/inc/LayerDecorator.h
index df4e2b945f2957ffad1f9c19ee4582ce5b5a584f..8e4ea54e82ca8f450dfcb20ebaa85838b536c971 100644
--- a/Core/Samples/inc/LayerDecorator.h
+++ b/Core/Samples/inc/LayerDecorator.h
@@ -16,13 +16,14 @@
 #ifndef LAYERDECORATOR_H_
 #define LAYERDECORATOR_H_
 
+#include "WinDllMacros.h"
 #include "Layer.h"
 #include "ParticleDecoration.h"
 #include "LayerDecoratorDWBASimulation.h"
 
 //! Combines a Layer with an IDecoration.
 
-class LayerDecorator : public Layer
+class BA_CORE_API_ LayerDecorator : public Layer
 {
  public:
     //! Constructs LayerDecorator object by cloning _layer_ and _decoration_.
diff --git a/Core/Samples/inc/MaterialManager.h b/Core/Samples/inc/MaterialManager.h
index 8c0b0c07cf01cadc730a75b2b82532712c19351e..ee4c1c339d1677c405ccc2558673cb5b348e1bd3 100644
--- a/Core/Samples/inc/MaterialManager.h
+++ b/Core/Samples/inc/MaterialManager.h
@@ -16,19 +16,20 @@
 #ifndef MATERIALMANAGER_H
 #define MATERIALMANAGER_H
 
-#include <iostream>
-#include <string>
-#include <map>
+#include "WinDllMacros.h"
 #include "Exceptions.h"
 #include "ISingleton.h"
 #include "HomogeneousMaterial.h"
+#include <iostream>
+#include <string>
+#include <map>
 
 //! Manager of materials used in simulation.
 
 //! A singleton that maintains a database of materials, and
 //! provides a common and unique interface for material creation and access.
 //!
-class MaterialManager: public ISingleton<MaterialManager>
+class BA_CORE_API_ MaterialManager: public ISingleton<MaterialManager>
 {
  public:
     typedef std::map<std::string, IMaterial*> materials_t;
diff --git a/Core/Samples/inc/MultiLayer.h b/Core/Samples/inc/MultiLayer.h
index b700b78241867ce8dbe0d5d477f54c7eba198264..5ed64919e3f95dde611caf7107700b60f94f1a6a 100644
--- a/Core/Samples/inc/MultiLayer.h
+++ b/Core/Samples/inc/MultiLayer.h
@@ -17,6 +17,7 @@
 #define MULTILAYER_H
 
 #include <vector>
+#include "WinDllMacros.h"
 #include "Layer.h"
 #include "LayerInterface.h"
 #include "LayerRoughness.h"
@@ -35,7 +36,7 @@
 //!  ---------   interface #2
 //!  substrate   layer #3        z=getLayerBottomZ(3)=-60.0
 
-class MultiLayer : public ICompositeSample
+class BA_CORE_API_ MultiLayer : public ICompositeSample
 {
  public:
     MultiLayer();
diff --git a/Core/Samples/inc/Particle.h b/Core/Samples/inc/Particle.h
index b2fcf42d69070d82b6dd49c0e794b8d77c4601c4..cbc1fbef36e86eccd37d1737725ab44d079eb738 100644
--- a/Core/Samples/inc/Particle.h
+++ b/Core/Samples/inc/Particle.h
@@ -25,7 +25,7 @@ class ParticleInfo;
 
 //! A particle with a form factor and refractive index
 
-class Particle : public ICompositeSample
+class BA_CORE_API_ Particle : public ICompositeSample
 {
  public:
     Particle(const complex_t& refractive_index, IFormFactor* p_form_factor = 0);
diff --git a/Core/Samples/inc/ParticleDecoration.h b/Core/Samples/inc/ParticleDecoration.h
index ac77992fd89c763840a64841a3c73847d5bc2147..b9c2e5d13aa4b91ef368686aaf6ba9404c9448e2 100644
--- a/Core/Samples/inc/ParticleDecoration.h
+++ b/Core/Samples/inc/ParticleDecoration.h
@@ -23,7 +23,7 @@
 
 //! Decorator class that adds particles to ISample objects
 
-class ParticleDecoration : public IDecoration
+class BA_CORE_API_ ParticleDecoration : public IDecoration
 {
  public:
     ParticleDecoration()
diff --git a/Core/Tools/inc/AxisDouble.h b/Core/Tools/inc/AxisDouble.h
index c2e930e95b4b0ff503e0eb09a694332343c5a72b..a861939c582371d03eb219f65ae7ac4e38193ac3 100644
--- a/Core/Tools/inc/AxisDouble.h
+++ b/Core/Tools/inc/AxisDouble.h
@@ -16,13 +16,14 @@
 #ifndef AXISDOUBLE_H_
 #define AXISDOUBLE_H_
 
+#include "WinDllMacros.h"
 #include "IAxis.h"
 
 class AxisBin;  // forward declaration needed for conversion constructor
 
 //! The points of an axis
 
-class AxisDouble : public IAxis
+class BA_CORE_API_ AxisDouble : public IAxis
 {
  public:
     //! constructors
diff --git a/Core/Tools/inc/Exceptions.h b/Core/Tools/inc/Exceptions.h
index eb9fbeef372833ff288de67807fe46c20ccc65de..9b07366ddb959135786b4df4a24da741f85f1518 100644
--- a/Core/Tools/inc/Exceptions.h
+++ b/Core/Tools/inc/Exceptions.h
@@ -16,96 +16,97 @@
 #ifndef EXCEPTIONS_H
 #define EXCEPTIONS_H
 
+#include "WinDllMacros.h"
 #include <stdexcept>
 
 namespace Exceptions {
 
-    class NotImplementedException : public std::logic_error
+    class BA_CORE_API_ NotImplementedException : public std::logic_error
     {
     public:
         NotImplementedException(const std::string& message);
     };
 
-    class NullPointerException : public std::logic_error
+    class BA_CORE_API_ NullPointerException : public std::logic_error
     {
     public:
         NullPointerException(const std::string& message);
     };
 
-    class OutOfBoundsException : public std::logic_error
+    class BA_CORE_API_ OutOfBoundsException : public std::logic_error
     {
     public:
         OutOfBoundsException(const std::string& message);
     };
 
-    class ClassInitializationException : public std::runtime_error
+    class BA_CORE_API_ ClassInitializationException : public std::runtime_error
     {
     public:
         ClassInitializationException(const std::string& message);
     };
 
-    class SelfReferenceException : public std::logic_error
+    class BA_CORE_API_ SelfReferenceException : public std::logic_error
     {
     public:
         SelfReferenceException(const std::string& message);
     };
 
-    class DeadReferenceException : public std::runtime_error
+    class BA_CORE_API_ DeadReferenceException : public std::runtime_error
     {
     public:
         DeadReferenceException(const std::string& message);
     };
 
-    class UnknownClassRegistrationException : public std::runtime_error
+    class BA_CORE_API_ UnknownClassRegistrationException : public std::runtime_error
     {
     public:
         UnknownClassRegistrationException(const std::string& message);
     };
 
-    class ExistingClassRegistrationException : public std::runtime_error
+    class BA_CORE_API_ ExistingClassRegistrationException : public std::runtime_error
     {
     public:
         ExistingClassRegistrationException(const std::string& message);
     };
 
-    class LogicErrorException : public std::logic_error
+    class BA_CORE_API_ LogicErrorException : public std::logic_error
     {
     public:
         LogicErrorException(const std::string& message);
     };
 
-    class RuntimeErrorException : public std::runtime_error
+    class BA_CORE_API_ RuntimeErrorException : public std::runtime_error
     {
     public:
         RuntimeErrorException(const std::string& message);
     };
 
-    class DivisionByZeroException : public std::runtime_error
+    class BA_CORE_API_ DivisionByZeroException : public std::runtime_error
     {
     public:
         DivisionByZeroException(const std::string& message);
     };
 
-    class DomainErrorException : public std::domain_error
+    class BA_CORE_API_ DomainErrorException : public std::domain_error
     {
     public:
         DomainErrorException(const std::string& message);
     };
 
-    class FileNotIsOpenException : public std::runtime_error
+    class BA_CORE_API_ FileNotIsOpenException : public std::runtime_error
     {
     public:
         FileNotIsOpenException(const std::string& message);
     };
 
 
-    class FileIsBadException : public std::runtime_error
+    class BA_CORE_API_ FileIsBadException : public std::runtime_error
     {
     public:
         FileIsBadException(const std::string& message);
     };
 
-    class FormatErrorException : public std::runtime_error
+    class BA_CORE_API_ FormatErrorException : public std::runtime_error
     {
     public:
         FormatErrorException(const std::string& message);
diff --git a/Core/Tools/inc/IParameterized.h b/Core/Tools/inc/IParameterized.h
index 53bc2c5fb9d0e58f49f8683a7babacdd50d37167..ed693d7c9a74e68f1acd3af89da9c5a0418c660b 100644
--- a/Core/Tools/inc/IParameterized.h
+++ b/Core/Tools/inc/IParameterized.h
@@ -16,13 +16,14 @@
 #ifndef IPARAMETERIZED_H_
 #define IPARAMETERIZED_H_
 
+#include "WinDllMacros.h"
 #include "INamed.h"
 #include "IChangeable.h"
 #include "ParameterPool.h"
 
 //! Manage a "local" parameter pool, and a tree of children's pools.
 
-class IParameterized : public INamed
+class BA_CORE_API_ IParameterized : public INamed
 {
  public:
     IParameterized()
diff --git a/Core/Tools/inc/OutputDataFunctions.h b/Core/Tools/inc/OutputDataFunctions.h
index 717ec1fbe919eda6b7397ba27e2379f107ccd7be..e74f358d769de3e61527805c14364d2c811cd1c3 100644
--- a/Core/Tools/inc/OutputDataFunctions.h
+++ b/Core/Tools/inc/OutputDataFunctions.h
@@ -16,6 +16,7 @@
 #ifndef OUTPUTDATAFUNCTIONS_H
 #define OUTPUTDATAFUNCTIONS_H
 
+#include "WinDllMacros.h"
 #include "Types.h"
 #include "OutputData.h"
 #include "IIntensityFunction.h"
@@ -55,7 +56,7 @@ namespace OutputDataFunctions
         OutputData<double>& data, const IIntensityFunction *func);
 
     //! Creates a rectangular mask based on the given OutputData object and limits
-    Mask *CreateRectangularMask(
+    BA_CORE_API_ Mask *CreateRectangularMask(
         const OutputData<double>& data,
         const double *minima, const double *maxima);
     Mask *CreateRectangularMask(
@@ -63,7 +64,7 @@ namespace OutputDataFunctions
         double x1, double y1, double x2, double y2);
 
     //! Creates a elliptic mask based on the given OutputData object and limits
-    Mask *CreateEllipticMask(
+    BA_CORE_API_ Mask *CreateEllipticMask(
         const OutputData<double>& data,
         const double *center, const double *radii);
     Mask *CreateEllipticMask(
diff --git a/Core/Tools/inc/OutputDataIOFactory.h b/Core/Tools/inc/OutputDataIOFactory.h
index f6d6a8168a9d2185cb48105fda996358a72af6c5..1ab0e6216055363ecd3deda7ee1ec89a0afbe4f8 100644
--- a/Core/Tools/inc/OutputDataIOFactory.h
+++ b/Core/Tools/inc/OutputDataIOFactory.h
@@ -16,6 +16,7 @@
 #ifndef OUTPUTDATAIOFACTORY_H
 #define OUTPUTDATAIOFACTORY_H
 
+#include "WinDllMacros.h"
 #include "OutputDataReader.h"
 #include "OutputDataWriter.h"
 #include <string>
@@ -23,7 +24,7 @@
 
 //! Reads OutputData from files in different format
 
-class OutputDataIOFactory
+class BA_CORE_API_ OutputDataIOFactory
 {
  public:
     typedef boost::shared_ptr<OutputDataReader > OutputDataReader_t;
diff --git a/Core/Tools/inc/ParameterPool.h b/Core/Tools/inc/ParameterPool.h
index 5c8fb237e8a58e59a44d45eef8aeb504ed962377..1d36436f56f6bf3fc26f7ff816058c802ddce5d5 100644
--- a/Core/Tools/inc/ParameterPool.h
+++ b/Core/Tools/inc/ParameterPool.h
@@ -16,6 +16,7 @@
 #ifndef PARAMETERPOOL_H
 #define PARAMETERPOOL_H
 
+#include "WinDllMacros.h"
 #include "ICloneable.h"
 #include "RealParameterWrapper.h"
 #include <map>
@@ -23,7 +24,7 @@
 
 //! Holds a map of pointers to parameters (which must have different names).
 
-class ParameterPool : public ICloneable
+class BA_CORE_API_ ParameterPool : public ICloneable
 {
  public:
     //! definition of parameter type and parameter container
diff --git a/Core/Tools/inc/RealParameterWrapper.h b/Core/Tools/inc/RealParameterWrapper.h
index ce9bb1f29d216b1881800e692a4fe8b955836c38..3db61aa68aa392418b07f7c87fdeb551ffa11dfc 100644
--- a/Core/Tools/inc/RealParameterWrapper.h
+++ b/Core/Tools/inc/RealParameterWrapper.h
@@ -16,13 +16,14 @@
 #ifndef REALPARAMETERWRAPPER_H
 #define REALPARAMETERWRAPPER_H
 
+#include "WinDllMacros.h"
 #include "Exceptions.h"
 
 #include <ostream>
 
 //! Wrapper to real parameter for remote access to its value and callback abilities
 
-class RealParameterWrapper {
+class BA_CORE_API_ RealParameterWrapper {
  public:
     explicit RealParameterWrapper(double *par) : m_data(par) {}
     // explicit RealParameterWrapper(double *par) : m_data(par), m_signal() {}
diff --git a/Core/Tools/inc/Utils.h b/Core/Tools/inc/Utils.h
index f472c5f042d254f123abf48bfaae9ea9efc1a5bc..ab8dd7d70a59c0cb2938581e98850b1f313e5a6c 100644
--- a/Core/Tools/inc/Utils.h
+++ b/Core/Tools/inc/Utils.h
@@ -16,6 +16,7 @@
 #ifndef UTILS_H
 #define UTILS_H
 
+#include "WinDllMacros.h"
 #include "Types.h"
 #include "Exceptions.h"
 #include <boost/unordered_map.hpp>
@@ -83,7 +84,7 @@ class StringUsageMap
 
 //! Utilities to deal with file system.
 
-class FileSystem
+class BA_CORE_API_ FileSystem
 {
  public:
     //! Returns path to the current (working) directory
diff --git a/Core/Tools/inc/WinDllMacros.h b/Core/Tools/inc/WinDllMacros.h
new file mode 100644
index 0000000000000000000000000000000000000000..bac8a0cac2f0a0c44c95576b715fb89d8d940972
--- /dev/null
+++ b/Core/Tools/inc/WinDllMacros.h
@@ -0,0 +1,18 @@
+#ifndef WINDLLMACROS_H
+#define WINDLLMACROS_H
+
+#ifdef _WIN32
+
+#ifdef BA_CORE_BUILD_DLL
+#define BA_CORE_API_ __declspec(dllexport)
+#else
+#define BA_CORE_API_ __declspec(dllimport)
+#endif  // BA_CORE_BUILD_DLL
+
+#endif  // _WIN32
+
+#ifndef BA_CORE_API_
+#define BA_CORE_API_
+#endif
+
+#endif // WINDLLMACROS_H
diff --git a/Fit/PythonAPI/src/PythonModule.cpp b/Fit/PythonAPI/src/PythonModule.cpp
index c07346ae29958b52dfa4432a5d92272c21403dcc..4939e22e729fe3a745fead925215d112dddf42ac 100644
--- a/Fit/PythonAPI/src/PythonModule.cpp
+++ b/Fit/PythonAPI/src/PythonModule.cpp
@@ -1,4 +1,4 @@
-#include "Python.h"
+#include "boost/python/detail/wrap_python.hpp"
 #include "Macros.h"
 GCC_DIAG_OFF(unused-parameter);
 GCC_DIAG_OFF(missing-field-initializers);
diff --git a/Tests/FunctionalTests/TestCore/IsGISAXS01/IsGISAXS01.pro b/Tests/FunctionalTests/TestCore/IsGISAXS01/IsGISAXS01.pro
index e6eb9f89c789b19f5cdcc1bfeb4ffde1b0d00d4a..80c32148bef203cb9eeb6c94677b761dc43c3e5d 100644
--- a/Tests/FunctionalTests/TestCore/IsGISAXS01/IsGISAXS01.pro
+++ b/Tests/FunctionalTests/TestCore/IsGISAXS01/IsGISAXS01.pro
@@ -5,7 +5,7 @@ QT      -= core gui
 
 include($$PWD/../../../../shared.pri)
 DEFINES += STANDALONE
-LIBS += $$PWD/../../../../lib/libBornAgainCore.so
+LIBS += $$PWD/../../../../lib/libBornAgainCore.$${SONAME}
 
 SOURCES += IsGISAXS01.cpp
 HEADERS += IsGISAXS01.h
diff --git a/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.pro b/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.pro
index 39bbbc68109899248ffdd9b5981081808e4e0897..e4510650c8e2c98b22ecc9d2a78e3f944f77834c 100644
--- a/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.pro
+++ b/Tests/FunctionalTests/TestCore/IsGISAXS02/IsGISAXS02.pro
@@ -5,7 +5,7 @@ QT      -= core gui
 
 include($$PWD/../../../../shared.pri)
 DEFINES += STANDALONE
-LIBS += $$PWD/../../../../lib/libBornAgainCore.so
+LIBS += $$PWD/../../../../lib/libBornAgainCore.$${SONAME}
 
 SOURCES += IsGISAXS02.cpp
 HEADERS += IsGISAXS02.h
diff --git a/Tests/FunctionalTests/TestCore/TestCore.pro b/Tests/FunctionalTests/TestCore/TestCore.pro
index d5cd8b0d8ab066f4174d71259caade0e2433189e..dee3bb7551fb0aa6f1321426f5680fa91c345f11 100644
--- a/Tests/FunctionalTests/TestCore/TestCore.pro
+++ b/Tests/FunctionalTests/TestCore/TestCore.pro
@@ -1,6 +1,5 @@
 TEMPLATE = subdirs
 
-
 SUBDIRS += \
     IsGISAXS01 \
     IsGISAXS02 \
diff --git a/Tests/UnitTests/TestCore/TestCore.pro b/Tests/UnitTests/TestCore/TestCore.pro
index def22fd1a35ad0bd926eea0c36be2a87f27a96c0..4fff6c63fd4c5c6590a0f71a6e562b88d8f94454 100644
--- a/Tests/UnitTests/TestCore/TestCore.pro
+++ b/Tests/UnitTests/TestCore/TestCore.pro
@@ -3,7 +3,9 @@
 ###############################################################################
 TEMPLATE = app
 CONFIG  -= qt app_bundle
-CONFIG  += console build_all
+CONFIG  += console release
+TARGET = TestCore
+DESTDIR = $$PWD
 QT      -= core gui
 
 # including common project properties
diff --git a/shared.pri b/shared.pri
index b678307446f56a3373728c63990e6a49652389d4..09cbf0e19de028336648b79d9a9c8ed1817750fd 100644
--- a/shared.pri
+++ b/shared.pri
@@ -1,6 +1,7 @@
 win32 {
     MAKE_COMMAND = mingw32-make
     SONAME = a
+    DEFINES += _WIN32
 }
 macx|unix {
     MAKE_COMMAND = make
@@ -99,7 +100,7 @@ win32 {
 isEmpty(BOOST_LIB): message("Can't find" $${BOOST_LIBFILES} "in" $${BOOST_LIB_LOCATIONS})
 INCLUDEPATH *=  $${BOOST_INCLUDE}
 LIBS *= -L$${BOOST_LIB}
-LIBS += -lboost_program_options -lboost_iostreams -lboost_system -lboost_signals -lboost_filesystem -lboost_regex -lboost_thread
+LIBS += -lboost_program_options -lboost_iostreams -lboost_system -lboost_signals -lboost_filesystem -lboost_regex -lboost_thread -lz
 # checking special case when system doesn't have libboost_thread library but have libboost_thread-mt
 !win32 {
   NumberOfSuchFiles=$$system(ls $${BOOST_LIB}/libboost_thread-mt* 2> /dev/null | wc -l)
diff --git a/windlls/libboost_python-mgw47-1_53.dll b/windlls/libboost_python-mgw47-1_53.dll
new file mode 100644
index 0000000000000000000000000000000000000000..2bdc243bfcaebf37315cc10eef6a3add493152c1
Binary files /dev/null and b/windlls/libboost_python-mgw47-1_53.dll differ
diff --git a/windlls/zlib1.dll b/windlls/zlib1.dll
new file mode 100644
index 0000000000000000000000000000000000000000..9ea38d5cf3e0ddbeaccc0122ce3cdb6c3741a3e1
Binary files /dev/null and b/windlls/zlib1.dll differ