<div dir="ltr"><div class="gmail_extra">Roger,<br><br></div><div class="gmail_extra">Did you try to remove all the explicit template exports? I never had to do it and compiled many static and shared libraries on Windows. Of course VS is going to complain about exporting template classes but as long as you don't try to mix VS versions I think you can safely ingore those warnings.<br><br></div><div class="gmail_extra">Also, this block of code in a.h, b.h, etc.:<br><br><pre>#ifndef A_H
#define A_H

#include <string>
#include "aexport.h"

#ifdef a_BUILT_AS_STATIC
#  define a_EXPORT_TEMPLATE
#else
#  ifndef a_EXPORT_TEMPLATE
#    ifdef a_EXPORTS
        /* We are building this library */
#      define a_EXPORT_TEMPLATE
#    else
        /* We are using this library */
#      define a_EXPORT_TEMPLATE extern
#    endif
#  endif

#  ifndef A_NO_EXPORT
#    define A_NO_EXPORT 
#  endif
#endif

#ifdef _MSC_VER
// Explicit template exports.
#include <string>
a_EXPORT_TEMPLATE template class a_EXPORT std::allocator<char>;
a_EXPORT_TEMPLATE template struct a_EXPORT std::char_traits<char>;
a_EXPORT_TEMPLATE template class a_EXPORT std::basic_string<char, std::char_traits<char>, std::allocator<char> >;
#endif

class a_EXPORT a
{
  std::string val;

 public:
  a();

  std::string const&
  getval() const;
};

#endif // A_H</pre><span class="pl-k"><br></span></div><div class="gmail_extra"><span class="pl-k">seems redundant. I would remove it. Including aexport.h should be enough.<br></span></div><div class="gmail_extra"><br></div><div class="gmail_extra">Hope this helps.<br><br></div><div class="gmail_extra">Guillaume<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 30, 2015 at 8:45 AM, Roger Leigh <span dir="ltr"><<a href="mailto:rleigh@codelibre.net" target="_blank">rleigh@codelibre.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ibraries which </blockquote></div><br><br><br clear="all"><br>-- <br><div>Guillaume Dumont<br>=========================<br><a href="mailto:dumont.guillaume@gmail.com" target="_blank">dumont.guillaume@gmail.com</a></div>
</div></div>