BIND 10 trac2214, updated. 80869705c65a2ba9134f47e20cf54c86cfbdb7fa add DLL import/export decoration

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Aug 20 21:27:07 UTC 2012


The branch, trac2214 has been updated
       via  80869705c65a2ba9134f47e20cf54c86cfbdb7fa (commit)
      from  01aec1c7f772752e9a0bc9f3885257f7866f0a4c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 80869705c65a2ba9134f47e20cf54c86cfbdb7fa
Author: Francis Dupont <fdupont at isc.org>
Date:   Mon Aug 20 23:26:55 2012 +0200

    add DLL import/export decoration

-----------------------------------------------------------------------

Summary of changes:
 src/lib/acl/Makefile.am                            |    2 +-
 src/lib/acl/acl.h                                  |    2 +
 src/lib/acl/check.h                                |    2 +
 src/{bin/resolver/common.h => lib/acl/dll.h}       |   23 +++++---
 src/lib/acl/dns.cc                                 |    4 +-
 src/lib/acl/dns.h                                  |   10 ++--
 src/lib/acl/dnsname_check.h                        |    1 +
 src/lib/acl/ip_check.cc                            |    2 +
 src/lib/acl/ip_check.h                             |    7 ++-
 src/lib/acl/loader.cc                              |    5 +-
 src/lib/acl/loader.h                               |    9 +--
 src/lib/acl/logic_check.h                          |    5 +-
 src/lib/asiodns/Makefile.am                        |    2 +-
 src/lib/asiodns/asiodns.h                          |    1 +
 src/{bin/resolver/common.h => lib/asiodns/dll.h}   |   23 +++++---
 src/lib/asiodns/dns_answer.h                       |    3 +-
 src/lib/asiodns/dns_lookup.h                       |    3 +-
 src/lib/asiodns/dns_server.h                       |    3 +-
 src/lib/asiodns/dns_service.cc                     |    6 +-
 src/lib/asiodns/dns_service.h                      |   12 ++--
 src/lib/asiodns/io_fetch.cc                        |    2 +
 src/lib/asiodns/io_fetch.h                         |    3 +-
 src/lib/asiodns/logger.cc                          |    2 +
 src/lib/asiodns/logger.h                           |    1 +
 src/lib/asiodns/sync_udp_server.cc                 |    2 +
 src/lib/asiodns/sync_udp_server.h                  |    4 +-
 src/lib/asiodns/tcp_server.cc                      |    2 +
 src/lib/asiodns/udp_server.cc                      |    2 +
 src/lib/asiodns/udp_server.h                       |    4 +-
 src/lib/asiolink/Makefile.am                       |   10 ++--
 src/lib/asiolink/asiolink.h                        |    2 +
 src/{bin/resolver/common.h => lib/asiolink/dll.h}  |   23 +++++---
 .../{asiodns/logger.cc => asiolink/dummy_io_cb.cc} |   16 +++---
 src/lib/asiolink/dummy_io_cb.h                     |    3 +-
 src/lib/asiolink/interval_timer.cc                 |    2 +
 src/lib/asiolink/interval_timer.h                  |    3 +-
 src/lib/asiolink/io_address.cc                     |    2 +
 src/lib/asiolink/io_address.h                      |    3 +-
 src/lib/asiolink/io_asio_socket.h                  |    9 +--
 src/lib/asiolink/io_endpoint.cc                    |    4 +-
 src/lib/asiolink/io_endpoint.h                     |    6 +-
 .../unittests/resource.cc => asiolink/io_error.cc} |   28 +++++-----
 src/lib/asiolink/io_error.h                        |    3 +-
 .../{asiodns/logger.cc => asiolink/io_message.cc}  |   16 +++---
 src/lib/asiolink/io_message.h                      |    3 +-
 src/lib/asiolink/io_service.cc                     |    2 +
 src/lib/asiolink/io_service.h                      |    4 +-
 src/lib/asiolink/io_socket.cc                      |    2 +
 src/lib/asiolink/io_socket.h                       |    4 +-
 .../logger.cc => asiolink/simple_callback.cc}      |   16 +++---
 src/lib/asiolink/simple_callback.h                 |    3 +-
 src/lib/asiolink/tcp_endpoint.h                    |    3 +-
 src/lib/asiolink/tcp_socket.h                      |    3 +-
 src/lib/asiolink/udp_endpoint.h                    |    3 +-
 src/lib/asiolink/udp_socket.h                      |    1 +
 src/lib/bench/Makefile.am                          |    2 +-
 src/lib/bench/benchmark.h                          |    1 +
 src/lib/bench/benchmark_util.cc                    |    6 +-
 src/lib/bench/benchmark_util.h                     |   15 +++--
 src/{bin/resolver/common.h => lib/bench/dll.h}     |   23 +++++---
 src/lib/cache/Makefile.am                          |    3 +-
 src/lib/cache/cache_entry_key.cc                   |    6 +-
 src/lib/cache/cache_entry_key.h                    |    5 +-
 src/{bin/resolver/common.h => lib/cache/dll.h}     |   23 +++++---
 src/lib/cache/local_zone_data.cc                   |    2 +
 src/lib/cache/local_zone_data.h                    |    3 +-
 src/lib/cache/logger.cc                            |    2 +
 src/lib/cache/logger.h                             |    1 +
 src/lib/cache/message_cache.cc                     |    2 +
 src/lib/cache/message_cache.h                      |    3 +-
 src/lib/cache/message_entry.cc                     |    2 +
 src/lib/cache/message_entry.h                      |    7 ++-
 src/lib/cache/message_utility.cc                   |    2 +
 src/lib/cache/message_utility.h                    |    1 +
 src/lib/cache/resolver_cache.cc                    |    2 +
 src/lib/cache/resolver_cache.h                     |    9 +--
 src/lib/cache/rrset_cache.cc                       |    2 +
 src/lib/cache/rrset_cache.h                        |    5 +-
 src/lib/cache/rrset_copy.cc                        |    4 +-
 src/lib/cache/rrset_copy.h                         |    3 +-
 src/lib/cache/rrset_entry.cc                       |    2 +
 src/lib/cache/rrset_entry.h                        |    5 +-
 src/lib/cc/Makefile.am                             |    2 +-
 src/lib/cc/data.cc                                 |   17 +++---
 src/lib/cc/data.h                                  |   39 +++++++------
 src/{bin/resolver/common.h => lib/cc/dll.h}        |   23 +++++---
 src/lib/cc/logger.cc                               |    2 +
 src/lib/cc/logger.h                                |    1 +
 src/lib/cc/session.cc                              |    2 +
 src/lib/cc/session.h                               |    9 +--
 src/lib/config/Makefile.am                         |    3 +-
 src/lib/config/ccsession.cc                        |   20 ++++---
 src/lib/config/ccsession.h                         |   38 +++++++------
 src/lib/config/config_data.cc                      |    2 +
 src/lib/config/config_data.h                       |    5 +-
 src/lib/config/config_log.cc                       |    2 +
 src/lib/config/config_log.h                        |    1 +
 src/{bin/resolver/common.h => lib/config/dll.h}    |   23 +++++---
 src/lib/config/module_spec.cc                      |    2 +
 src/lib/config/module_spec.h                       |    9 +--
 src/lib/cryptolink/Makefile.am                     |    3 +-
 src/lib/cryptolink/crypto_hmac.cc                  |    8 ++-
 src/lib/cryptolink/crypto_hmac.h                   |    7 ++-
 src/lib/cryptolink/cryptolink.cc                   |    2 +
 src/lib/cryptolink/cryptolink.h                    |   15 ++---
 .../resolver/common.h => lib/cryptolink/dll.h}     |   23 +++++---
 src/lib/datasrc/Makefile.am                        |    3 +-
 src/lib/datasrc/cache.cc                           |    2 +
 src/lib/datasrc/cache.h                            |   12 ++--
 src/lib/datasrc/client.h                           |    5 +-
 src/lib/datasrc/client_list.cc                     |    2 +
 src/lib/datasrc/client_list.h                      |   13 +++--
 src/lib/datasrc/data_source.cc                     |    2 +
 src/lib/datasrc/data_source.h                      |   29 +++++-----
 src/lib/datasrc/database.cc                        |    2 +
 src/lib/datasrc/database.h                         |    5 +-
 src/{bin/resolver/common.h => lib/datasrc/dll.h}   |   23 +++++---
 src/lib/datasrc/factory.cc                         |    2 +
 src/lib/datasrc/factory.h                          |   10 ++--
 src/lib/datasrc/iterator.h                         |    4 +-
 src/lib/datasrc/logger.cc                          |    2 +
 src/lib/datasrc/logger.h                           |    1 +
 src/lib/datasrc/memory/Makefile.am                 |    1 +
 .../resolver/common.h => lib/datasrc/memory/dll.h} |   23 +++++---
 src/lib/datasrc/memory/domaintree.h                |    1 +
 src/lib/datasrc/memory/rdata_encoder.cc            |    6 +-
 src/lib/datasrc/memory/rdata_encoder.h             |    8 ++-
 src/lib/datasrc/memory_datasrc.cc                  |    2 +
 src/lib/datasrc/memory_datasrc.h                   |   17 +++---
 src/lib/datasrc/memory_datasrc_link.cc             |    8 ++-
 src/lib/datasrc/query.cc                           |    2 +
 src/lib/datasrc/query.h                            |    7 ++-
 src/lib/datasrc/rbnode_rrset.h                     |    5 +-
 src/lib/datasrc/rbtree.h                           |    1 +
 src/lib/datasrc/result.h                           |    2 +
 src/lib/datasrc/sqlite3_accessor.cc                |    2 +
 src/lib/datasrc/sqlite3_accessor.h                 |   19 ++++---
 src/lib/datasrc/sqlite3_accessor_link.cc           |    6 +-
 src/lib/datasrc/sqlite3_datasrc.cc                 |    4 +-
 src/lib/datasrc/sqlite3_datasrc.h                  |   19 ++++---
 src/lib/datasrc/static_datasrc.cc                  |    2 +
 src/lib/datasrc/static_datasrc.h                   |   13 +++--
 src/lib/datasrc/static_datasrc_link.cc             |    6 +-
 src/lib/datasrc/zone.h                             |   12 ++--
 src/lib/datasrc/zone_finder_context.cc             |    2 +
 src/lib/datasrc/zonetable.cc                       |    2 +
 src/lib/datasrc/zonetable.h                        |    7 ++-
 src/lib/dhcp/Makefile.am                           |    2 +-
 src/{bin/resolver/common.h => lib/dhcp/dll.h}      |   23 +++++---
 src/lib/dhcp/iface_mgr.cc                          |    2 +
 src/lib/dhcp/iface_mgr.h                           |    5 +-
 src/lib/dhcp/iface_mgr_bsd.cc                      |    2 +
 src/lib/dhcp/iface_mgr_linux.cc                    |    2 +
 src/lib/dhcp/iface_mgr_sun.cc                      |    2 +
 src/lib/dhcp/libdhcp++.cc                          |    2 +
 src/lib/dhcp/libdhcp++.h                           |    3 +-
 src/lib/dhcp/option.cc                             |    2 +
 src/lib/dhcp/option.h                              |    5 +-
 src/lib/dhcp/option4_addrlst.cc                    |    2 +
 src/lib/dhcp/option4_addrlst.h                     |    3 +-
 src/lib/dhcp/option6_addrlst.cc                    |    2 +
 src/lib/dhcp/option6_addrlst.h                     |    3 +-
 src/lib/dhcp/option6_ia.cc                         |    2 +
 src/lib/dhcp/option6_ia.h                          |    3 +-
 src/lib/dhcp/option6_iaaddr.cc                     |    2 +
 src/lib/dhcp/option6_iaaddr.h                      |    3 +-
 src/lib/dhcp/pkt4.cc                               |    2 +
 src/lib/dhcp/pkt4.h                                |    3 +-
 src/lib/dhcp/pkt6.cc                               |    1 +
 src/lib/dhcp/pkt6.h                                |    3 +-
 src/lib/dns/Makefile.am                            |    2 +-
 src/lib/dns/character_string.cc                    |    2 +
 src/lib/dns/character_string.h                     |    9 ++-
 src/{bin/resolver/common.h => lib/dns/dll.h}       |   23 +++++---
 src/lib/dns/edns.cc                                |    4 +-
 src/lib/dns/edns.h                                 |   30 +++++-----
 src/lib/dns/exceptions.cc                          |    2 +
 src/lib/dns/exceptions.h                           |    9 +--
 src/lib/dns/labelsequence.cc                       |    4 +-
 src/lib/dns/labelsequence.h                        |    5 +-
 src/lib/dns/masterload.cc                          |    6 +-
 src/lib/dns/masterload.h                           |   17 +++---
 src/lib/dns/message.cc                             |    4 +-
 src/lib/dns/message.h                              |   33 ++++++-----
 src/lib/dns/messagerenderer.cc                     |    2 +
 src/lib/dns/messagerenderer.h                      |    9 +--
 src/lib/dns/name.cc                                |    4 +-
 src/lib/dns/name.h                                 |   28 +++++-----
 src/lib/dns/name_internal.h                        |    2 +
 src/lib/dns/nsec3hash.cc                           |    4 +-
 src/lib/dns/nsec3hash.h                            |   17 +++---
 src/lib/dns/opcode.cc                              |    4 +-
 src/lib/dns/opcode.h                               |    7 ++-
 src/lib/dns/python/Makefile.am                     |    3 +-
 src/lib/dns/python/{nsec3hash_python.h => dll.h}   |   59 +++++++++-----------
 src/lib/dns/python/edns_python.cc                  |   10 ++--
 src/lib/dns/python/edns_python.h                   |   13 +++--
 src/lib/dns/python/message_python.cc               |   12 ++--
 src/lib/dns/python/message_python.h                |   15 +++--
 src/lib/dns/python/messagerenderer_python.cc       |    8 ++-
 src/lib/dns/python/messagerenderer_python.h        |   11 ++--
 src/lib/dns/python/name_python.cc                  |   30 +++++-----
 src/lib/dns/python/name_python.h                   |   33 ++++++-----
 src/lib/dns/python/nsec3hash_python.cc             |    9 ++-
 src/lib/dns/python/nsec3hash_python.h              |   11 ++--
 src/lib/dns/python/opcode_python.cc                |   10 ++--
 src/lib/dns/python/opcode_python.h                 |   14 +++--
 src/lib/dns/python/pydnspp_common.cc               |   12 ++--
 src/lib/dns/python/pydnspp_common.h                |   10 +++-
 src/lib/dns/python/pydnspp_towire.h                |    1 +
 src/lib/dns/python/question_python.cc              |   10 ++--
 src/lib/dns/python/question_python.h               |   16 ++++--
 src/lib/dns/python/rcode_python.cc                 |   10 ++--
 src/lib/dns/python/rcode_python.h                  |   13 +++--
 src/lib/dns/python/rdata_python.cc                 |   16 +++---
 src/lib/dns/python/rdata_python.h                  |   17 +++---
 src/lib/dns/python/rrclass_python.cc               |   15 +++--
 src/lib/dns/python/rrclass_python.h                |   18 +++---
 src/lib/dns/python/rrset_python.cc                 |   14 +++--
 src/lib/dns/python/rrset_python.h                  |   13 +++--
 src/lib/dns/python/rrttl_python.cc                 |   14 +++--
 src/lib/dns/python/rrttl_python.h                  |   17 +++---
 src/lib/dns/python/rrtype_python.cc                |   14 +++--
 src/lib/dns/python/rrtype_python.h                 |   18 +++---
 src/lib/dns/python/serial_python.cc                |   10 ++--
 src/lib/dns/python/serial_python.h                 |   14 +++--
 src/lib/dns/python/tsig_python.cc                  |   10 ++--
 src/lib/dns/python/tsig_python.h                   |   14 +++--
 src/lib/dns/python/tsig_rdata_python.cc            |   10 ++--
 src/lib/dns/python/tsig_rdata_python.h             |   15 +++--
 src/lib/dns/python/tsigerror_python.cc             |    6 +-
 src/lib/dns/python/tsigerror_python.h              |    9 ++-
 src/lib/dns/python/tsigkey_python.cc               |   14 +++--
 src/lib/dns/python/tsigkey_python.h                |   21 ++++---
 src/lib/dns/python/tsigrecord_python.cc            |   10 ++--
 src/lib/dns/python/tsigrecord_python.h             |   15 +++--
 src/lib/dns/question.cc                            |    4 +-
 src/lib/dns/question.h                             |   15 +++--
 src/lib/dns/rcode.cc                               |    4 +-
 src/lib/dns/rcode.h                                |    7 ++-
 src/lib/dns/rdata.cc                               |   12 ++--
 src/lib/dns/rdata.h                                |   47 +++++++++-------
 src/lib/dns/rdata/any_255/tsig_250.h               |    5 +-
 src/lib/dns/rdata/ch_3/a_1.h                       |    3 +-
 src/lib/dns/rdata/generic/afsdb_18.h               |    3 +-
 src/lib/dns/rdata/generic/cname_5.h                |    3 +-
 src/lib/dns/rdata/generic/detail/ds_like.h         |    1 +
 .../dns/rdata/generic/detail/nsec3param_common.cc  |    2 +
 .../dns/rdata/generic/detail/nsec3param_common.h   |    1 +
 src/lib/dns/rdata/generic/detail/nsec_bitmap.cc    |    2 +
 src/lib/dns/rdata/generic/detail/nsec_bitmap.h     |    2 +
 src/lib/dns/rdata/generic/detail/txt_like.h        |    2 +
 src/lib/dns/rdata/generic/dlv_32769.h              |    3 +-
 src/lib/dns/rdata/generic/dname_39.h               |    3 +-
 src/lib/dns/rdata/generic/dnskey_48.h              |    3 +-
 src/lib/dns/rdata/generic/ds_43.h                  |    3 +-
 src/lib/dns/rdata/generic/hinfo_13.h               |    3 +-
 src/lib/dns/rdata/generic/minfo_14.h               |    3 +-
 src/lib/dns/rdata/generic/mx_15.h                  |    3 +-
 src/lib/dns/rdata/generic/naptr_35.h               |    3 +-
 src/lib/dns/rdata/generic/ns_2.h                   |    3 +-
 src/lib/dns/rdata/generic/nsec3_50.h               |    3 +-
 src/lib/dns/rdata/generic/nsec3param_51.h          |    3 +-
 src/lib/dns/rdata/generic/nsec_47.h                |    3 +-
 src/lib/dns/rdata/generic/opt_41.h                 |    3 +-
 src/lib/dns/rdata/generic/ptr_12.h                 |    3 +-
 src/lib/dns/rdata/generic/rp_17.h                  |    3 +-
 src/lib/dns/rdata/generic/rrsig_46.h               |    3 +-
 src/lib/dns/rdata/generic/soa_6.h                  |    3 +-
 src/lib/dns/rdata/generic/spf_99.h                 |    3 +-
 src/lib/dns/rdata/generic/sshfp_44.h               |    3 +-
 src/lib/dns/rdata/generic/txt_16.h                 |    3 +-
 src/lib/dns/rdata/hs_4/a_1.h                       |    3 +-
 src/lib/dns/rdata/in_1/a_1.h                       |    3 +-
 src/lib/dns/rdata/in_1/aaaa_28.h                   |    3 +-
 src/lib/dns/rdata/in_1/dhcid_49.h                  |    3 +-
 src/lib/dns/rdata/in_1/srv_33.h                    |    3 +-
 src/lib/dns/rdata/template.h                       |    3 +-
 src/lib/dns/rdatafields.cc                         |    2 +
 src/lib/dns/rdatafields.h                          |   11 ++--
 src/lib/dns/rrclass-placeholder.h                  |   16 +++---
 src/lib/dns/rrclass.cc                             |    4 +-
 src/lib/dns/rrparamregistry-placeholder.cc         |    2 +
 src/lib/dns/rrparamregistry.h                      |    9 +--
 src/lib/dns/rrset.cc                               |    4 +-
 src/lib/dns/rrset.h                                |   35 ++++++------
 src/lib/dns/rrsetlist.cc                           |    2 +
 src/lib/dns/rrsetlist.h                            |    5 +-
 src/lib/dns/rrttl.cc                               |    4 +-
 src/lib/dns/rrttl.h                                |   16 +++---
 src/lib/dns/rrtype-placeholder.h                   |   16 +++---
 src/lib/dns/rrtype.cc                              |    4 +-
 src/lib/dns/serial.cc                              |    4 +-
 src/lib/dns/serial.h                               |    7 ++-
 src/lib/dns/tests/message_unittest.cc              |    2 +-
 src/lib/dns/tests/tsig_unittest.cc                 |    2 +-
 src/lib/dns/tsig.cc                                |    2 +
 src/lib/dns/tsig.h                                 |    5 +-
 src/lib/dns/tsigerror.cc                           |    4 +-
 src/lib/dns/tsigerror.h                            |    6 +-
 src/lib/dns/tsigkey.cc                             |    2 +
 src/lib/dns/tsigkey.h                              |    7 ++-
 src/lib/dns/tsigrecord.cc                          |    4 +-
 src/lib/dns/tsigrecord.h                           |   10 ++--
 src/lib/exceptions/Makefile.am                     |    4 +-
 .../resolver/common.h => lib/exceptions/dll.h}     |   23 +++++---
 src/lib/exceptions/exceptions.cc                   |    2 +
 src/lib/exceptions/exceptions.h                    |   16 +++---
 src/lib/log/Makefile.am                            |    2 +-
 src/{bin/resolver/common.h => lib/log/dll.h}       |   23 +++++---
 src/lib/log/dummylog.cc                            |    8 ++-
 src/lib/log/dummylog.h                             |    8 ++-
 src/lib/log/log_dbglevels.h                        |    2 +
 src/lib/log/log_formatter.cc                       |    6 +-
 src/lib/log/log_formatter.h                        |    9 +--
 src/lib/log/logger.cc                              |    2 +
 src/lib/log/logger.h                               |    7 ++-
 src/lib/log/logger_impl.cc                         |    2 +
 src/lib/log/logger_impl.h                          |    1 +
 src/lib/log/logger_level.cc                        |    4 +-
 src/lib/log/logger_level.h                         |    4 +-
 src/lib/log/logger_level_impl.cc                   |    2 +
 src/lib/log/logger_level_impl.h                    |    3 +-
 src/lib/log/logger_manager.cc                      |    2 +
 src/lib/log/logger_manager.h                       |    5 +-
 src/lib/log/logger_manager_impl.cc                 |    2 +
 src/lib/log/logger_manager_impl.h                  |    5 +-
 src/lib/log/logger_name.cc                         |    8 ++-
 src/lib/log/logger_name.h                          |    8 ++-
 src/lib/log/logger_specification.h                 |    3 +-
 src/lib/log/logger_support.cc                      |    8 ++-
 src/lib/log/logger_support.h                       |    6 +-
 src/lib/log/logger_unittest_support.cc             |   10 ++--
 src/lib/log/logger_unittest_support.h              |    6 +-
 src/lib/log/logimpl_messages.cc                    |   11 +++-
 src/lib/log/logimpl_messages.h                     |    7 ++-
 src/lib/log/macros.h                               |    1 +
 src/lib/log/message_dictionary.cc                  |    2 +
 src/lib/log/message_dictionary.h                   |    3 +-
 src/lib/log/message_exception.h                    |    3 +-
 src/lib/log/message_initializer.cc                 |    2 +
 src/lib/log/message_initializer.h                  |    3 +-
 src/lib/log/message_reader.cc                      |    2 +
 src/lib/log/message_reader.h                       |    3 +-
 src/lib/log/message_types.h                        |    4 +-
 src/lib/log/output_option.cc                       |    2 +
 src/lib/log/output_option.h                        |    6 +-
 src/lib/nsas/Makefile.am                           |    3 +-
 src/lib/nsas/address_entry.cc                      |    2 +
 src/lib/nsas/address_entry.h                       |    3 +-
 src/lib/nsas/address_request_callback.h            |    3 +-
 src/{bin/resolver/common.h => lib/nsas/dll.h}      |   23 +++++---
 src/lib/nsas/fetchable.h                           |    4 +-
 src/lib/nsas/glue_hints.cc                         |    2 +
 src/lib/nsas/glue_hints.h                          |    3 +-
 src/lib/nsas/hash.cc                               |    2 +
 src/lib/nsas/hash.h                                |    5 +-
 src/lib/nsas/hash_deleter.h                        |    1 +
 src/lib/nsas/hash_key.cc                           |    2 +
 src/lib/nsas/hash_key.h                            |    3 +-
 src/lib/nsas/hash_table.h                          |    1 +
 src/lib/nsas/nameserver_address.cc                 |    2 +
 src/lib/nsas/nameserver_address.h                  |    9 +--
 src/lib/nsas/nameserver_address_store.cc           |    2 +
 src/lib/nsas/nameserver_address_store.h            |   11 ++--
 src/lib/nsas/nameserver_entry.cc                   |    2 +
 src/lib/nsas/nameserver_entry.h                    |   14 +++--
 src/lib/nsas/nsas_entry.h                          |    3 +-
 src/lib/nsas/nsas_entry_compare.h                  |    1 +
 src/lib/nsas/nsas_log.cc                           |    2 +
 src/lib/nsas/nsas_log.h                            |    1 +
 src/lib/nsas/nsas_types.h                          |    2 +
 src/lib/nsas/zone_entry.cc                         |    2 +
 src/lib/nsas/zone_entry.h                          |    7 ++-
 src/lib/resolve/Makefile.am                        |    3 +-
 .../python/nsec3hash_python.h => resolve/dll.h}    |   59 +++++++++-----------
 src/lib/resolve/recursive_query.cc                 |    6 +-
 src/lib/resolve/recursive_query.h                  |    5 +-
 src/lib/resolve/resolve.cc                         |   17 ++++--
 src/lib/resolve/resolve.h                          |   21 ++++---
 src/lib/resolve/resolve_log.cc                     |    2 +
 src/lib/resolve/resolve_log.h                      |    1 +
 src/lib/resolve/resolver_callback.cc               |    2 +
 src/lib/resolve/resolver_callback.h                |    4 +-
 src/lib/resolve/resolver_interface.h               |    3 +-
 src/lib/resolve/response_classifier.cc             |    2 +
 src/lib/resolve/response_classifier.h              |    3 +-
 src/lib/server_common/Makefile.am                  |    3 +-
 src/lib/server_common/client.cc                    |    4 +-
 src/lib/server_common/client.h                     |   12 ++--
 .../resolver/common.h => lib/server_common/dll.h}  |   23 +++++---
 src/lib/server_common/keyring.cc                   |    8 ++-
 src/lib/server_common/keyring.h                    |    7 ++-
 src/lib/server_common/logger.cc                    |    2 +
 src/lib/server_common/logger.h                     |    1 +
 src/lib/server_common/portconfig.cc                |    6 +-
 src/lib/server_common/portconfig.h                 |    6 +-
 src/lib/server_common/socket_request.cc            |   11 ++--
 src/lib/server_common/socket_request.h             |   24 ++++----
 src/lib/statistics/Makefile.am                     |    2 +-
 src/lib/statistics/counter.cc                      |    2 +
 src/lib/statistics/counter.h                       |    3 +-
 src/lib/statistics/counter_dict.cc                 |   18 +++---
 src/lib/statistics/counter_dict.h                  |   20 ++++---
 .../resolver/common.h => lib/statistics/dll.h}     |   23 +++++---
 src/lib/testutils/Makefile.am                      |    5 +-
 src/{bin/resolver/common.h => lib/testutils/dll.h} |   23 +++++---
 src/lib/testutils/dnsmessage_test.cc               |   16 +++---
 src/lib/testutils/dnsmessage_test.h                |   32 ++++++-----
 src/lib/testutils/mockups.h                        |   12 ++--
 src/lib/testutils/portconfig.h                     |    1 +
 .../common.h => lib/testutils/socket_request.cc}   |   20 +++++--
 src/lib/testutils/socket_request.h                 |    5 +-
 src/lib/testutils/srv_test.cc                      |    6 +-
 src/lib/testutils/srv_test.h                       |   27 ++++-----
 src/lib/util/Makefile.am                           |    7 ++-
 src/lib/{asiodns/logger.cc => util/buffer.cc}      |   15 ++---
 src/lib/util/buffer.h                              |    8 ++-
 src/{bin/resolver/common.h => lib/util/dll.h}      |   23 +++++---
 src/lib/util/encode/base16_from_binary.h           |    1 +
 src/lib/util/encode/base32hex.h                    |    4 ++
 src/lib/util/encode/base32hex_from_binary.h        |    1 +
 src/lib/util/encode/base64.h                       |    4 ++
 src/lib/util/encode/base_n.cc                      |   14 +++--
 src/lib/util/encode/binary_from_base16.h           |    1 +
 src/lib/util/encode/binary_from_base32hex.h        |    1 +
 src/lib/util/encode/hex.h                          |    4 ++
 src/lib/util/filename.cc                           |    2 +
 src/lib/util/filename.h                            |    5 +-
 src/lib/util/hash/sha1.cc                          |   14 +++--
 src/lib/util/hash/sha1.h                           |   17 +++---
 src/lib/util/interprocess_sync.h                   |    7 ++-
 src/lib/util/interprocess_sync_file.cc             |    2 +
 src/lib/util/interprocess_sync_file.h              |    5 +-
 src/lib/util/interprocess_sync_null.cc             |    2 +
 src/lib/util/interprocess_sync_null.h              |    3 +-
 src/lib/util/io/Makefile.am                        |    2 +-
 src/{bin/resolver/common.h => lib/util/io/dll.h}   |   23 +++++---
 src/lib/util/io/fd.cc                              |    6 +-
 src/lib/util/io/fd.h                               |    6 +-
 src/lib/util/io/fd_share.cc                        |    6 +-
 src/lib/util/io/fd_share.h                         |    6 +-
 src/lib/util/io/pktinfo_utilities.h                |    2 +
 src/lib/util/io/sockaddr_util.h                    |    2 +
 src/lib/util/io/socketsession.cc                   |    2 +
 src/lib/util/io/socketsession.h                    |   13 +++--
 src/lib/util/io_utilities.h                        |    2 +
 src/lib/util/locks.h                               |    8 ++-
 src/lib/util/lru_list.h                            |    1 +
 src/lib/util/memory_segment.h                      |    4 +-
 src/lib/util/memory_segment_local.cc               |    2 +
 src/lib/util/memory_segment_local.h                |    3 +-
 src/lib/util/nonassignable.h                       |    4 +-
 src/lib/util/noncopyable.h                         |    4 +-
 src/lib/util/python/pycppwrapper_util.h            |    4 +-
 src/lib/util/pyunittests/pyunittests_util.cc       |    4 +-
 src/lib/util/random/qid_gen.cc                     |    2 +
 src/lib/util/random/qid_gen.h                      |    3 +-
 .../random/random_number_generator.cc}             |   22 +++++---
 src/lib/util/random/random_number_generator.h      |   12 ++--
 src/lib/util/range_utilities.h                     |    2 +
 src/lib/util/strutil.cc                            |   12 ++--
 src/lib/util/strutil.h                             |   18 +++---
 src/lib/util/time_utilities.cc                     |   14 +++--
 src/lib/util/time_utilities.h                      |   14 +++--
 src/lib/util/unittests/Makefile.am                 |    2 +-
 .../resolver/common.h => lib/util/unittests/dll.h} |   23 +++++---
 src/lib/util/unittests/fork.cc                     |    8 ++-
 src/lib/util/unittests/fork.h                      |    8 ++-
 src/lib/util/unittests/newhook.cc                  |    6 +-
 src/lib/util/unittests/newhook.h                   |    6 +-
 src/lib/util/unittests/resource.cc                 |    4 +-
 src/lib/util/unittests/resource.h                  |    4 +-
 src/lib/util/unittests/run_all.cc                  |    4 +-
 src/lib/util/unittests/run_all.h                   |    4 +-
 src/lib/util/unittests/testdata.cc                 |    6 +-
 src/lib/util/unittests/testdata.h                  |    5 +-
 src/lib/util/unittests/textdata.h                  |    2 +
 src/lib/util/unittests/wiredata.cc                 |    4 +-
 src/lib/util/unittests/wiredata.h                  |    7 ++-
 src/lib/xfr/Makefile.am                            |    2 +-
 src/{bin/resolver/common.h => lib/xfr/dll.h}       |   23 +++++---
 src/lib/xfr/xfrout_client.cc                       |    2 +
 src/lib/xfr/xfrout_client.h                        |    8 ++-
 tests/tools/perfdhcp/Makefile.am                   |    3 +-
 tests/tools/perfdhcp/command_options.cc            |    2 +
 tests/tools/perfdhcp/command_options.h             |    4 +-
 .../common.h => tests/tools/perfdhcp/dll.h         |   23 +++++---
 tests/tools/perfdhcp/localized_option.h            |    4 +-
 tests/tools/perfdhcp/perf_pkt4.cc                  |    2 +
 tests/tools/perfdhcp/perf_pkt4.h                   |    3 +-
 tests/tools/perfdhcp/perf_pkt6.cc                  |    2 +
 tests/tools/perfdhcp/perf_pkt6.h                   |    3 +-
 tests/tools/perfdhcp/pkt_transform.cc              |    2 +
 tests/tools/perfdhcp/pkt_transform.h               |    1 +
 tests/tools/perfdhcp/stats_mgr.h                   |    2 +
 496 files changed, 2339 insertions(+), 1298 deletions(-)
 copy src/{bin/resolver/common.h => lib/acl/dll.h} (71%)
 copy src/{bin/resolver/common.h => lib/asiodns/dll.h} (70%)
 copy src/{bin/resolver/common.h => lib/asiolink/dll.h} (69%)
 copy src/lib/{asiodns/logger.cc => asiolink/dummy_io_cb.cc} (80%)
 copy src/lib/{util/unittests/resource.cc => asiolink/io_error.cc} (68%)
 copy src/lib/{asiodns/logger.cc => asiolink/io_message.cc} (81%)
 copy src/lib/{asiodns/logger.cc => asiolink/simple_callback.cc} (80%)
 copy src/{bin/resolver/common.h => lib/bench/dll.h} (70%)
 copy src/{bin/resolver/common.h => lib/cache/dll.h} (70%)
 copy src/{bin/resolver/common.h => lib/cc/dll.h} (72%)
 copy src/{bin/resolver/common.h => lib/config/dll.h} (70%)
 copy src/{bin/resolver/common.h => lib/cryptolink/dll.h} (68%)
 copy src/{bin/resolver/common.h => lib/datasrc/dll.h} (70%)
 copy src/{bin/resolver/common.h => lib/datasrc/memory/dll.h} (67%)
 copy src/{bin/resolver/common.h => lib/dhcp/dll.h} (71%)
 copy src/{bin/resolver/common.h => lib/dns/dll.h} (71%)
 copy src/lib/dns/python/{nsec3hash_python.h => dll.h} (56%)
 copy src/{bin/resolver/common.h => lib/exceptions/dll.h} (68%)
 copy src/{bin/resolver/common.h => lib/log/dll.h} (71%)
 copy src/{bin/resolver/common.h => lib/nsas/dll.h} (71%)
 copy src/lib/{dns/python/nsec3hash_python.h => resolve/dll.h} (56%)
 copy src/{bin/resolver/common.h => lib/server_common/dll.h} (67%)
 copy src/{bin/resolver/common.h => lib/statistics/dll.h} (68%)
 copy src/{bin/resolver/common.h => lib/testutils/dll.h} (69%)
 copy src/{bin/resolver/common.h => lib/testutils/socket_request.cc} (76%)
 copy src/lib/{asiodns/logger.cc => util/buffer.cc} (80%)
 copy src/{bin/resolver/common.h => lib/util/dll.h} (71%)
 copy src/{bin/resolver/common.h => lib/util/io/dll.h} (70%)
 copy src/lib/{asiodns/logger.cc => util/random/random_number_generator.cc} (70%)
 copy src/{bin/resolver/common.h => lib/util/unittests/dll.h} (67%)
 copy src/{bin/resolver/common.h => lib/xfr/dll.h} (71%)
 copy src/bin/resolver/common.h => tests/tools/perfdhcp/dll.h (70%)

-----------------------------------------------------------------------
diff --git a/src/lib/acl/Makefile.am b/src/lib/acl/Makefile.am
index 001ca59..a1569b4 100644
--- a/src/lib/acl/Makefile.am
+++ b/src/lib/acl/Makefile.am
@@ -6,7 +6,7 @@ AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 # The core library
 lib_LTLIBRARIES = libb10-acl.la
-libb10_acl_la_SOURCES  = acl.h
+libb10_acl_la_SOURCES  = dll.h acl.h
 libb10_acl_la_SOURCES += check.h
 libb10_acl_la_SOURCES += ip_check.h ip_check.cc
 libb10_acl_la_SOURCES += logic_check.h
diff --git a/src/lib/acl/acl.h b/src/lib/acl/acl.h
index dd0ea8d..ec7098a 100644
--- a/src/lib/acl/acl.h
+++ b/src/lib/acl/acl.h
@@ -22,6 +22,8 @@
 
 #include <util/noncopyable.h>
 
+#include <acl/dll.h>
+
 namespace isc {
 namespace acl {
 
diff --git a/src/lib/acl/check.h b/src/lib/acl/check.h
index 3297d4b..9d9e108 100644
--- a/src/lib/acl/check.h
+++ b/src/lib/acl/check.h
@@ -19,6 +19,8 @@
 #include <typeinfo>
 #include <sstream>
 
+#include <acl/dll.h>
+
 namespace isc {
 namespace acl {
 
diff --git a/src/lib/acl/dll.h b/src/lib/acl/dll.h
new file mode 100644
index 0000000..3f594bf
--- /dev/null
+++ b/src/lib/acl/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBACL_H
+#define __LIBACL_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBACL_API
+#else
+#ifdef B10_LIBACL_EXPORT
+#define B10_LIBACL_API __declspec(dllexport)
+#else
+#define B10_LIBACL_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBACL_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/acl/dns.cc b/src/lib/acl/dns.cc
index d16ec65..e192475 100644
--- a/src/lib/acl/dns.cc
+++ b/src/lib/acl/dns.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBACL_EXPORT
+
 #include <memory>
 #include <string>
 #include <vector>
@@ -104,7 +106,7 @@ internal::RequestCheckCreator::create(const string& name,
     }
 }
 
-RequestLoader&
+B10_LIBACL_API RequestLoader&
 getRequestLoader() {
     static RequestLoader* loader(NULL);
     if (loader == NULL) {
diff --git a/src/lib/acl/dns.h b/src/lib/acl/dns.h
index 1ea1c41..7363198 100644
--- a/src/lib/acl/dns.h
+++ b/src/lib/acl/dns.h
@@ -24,13 +24,14 @@
 
 #include <util/nonassignable.h>
 
+#include <acl/dll.h>
 #include <acl/ip_check.h>
 #include <acl/dnsname_check.h>
 #include <acl/loader.h>
 
 namespace isc {
 namespace dns {
-class TSIGRecord;
+class B10_LIBACL_API TSIGRecord;
 }
 namespace acl {
 namespace dns {
@@ -65,7 +66,7 @@ namespace dns {
  * are the local (destination) IP address, the remote and local port numbers,
  * various fields of the DNS request (e.g. a particular header flag value).
  */
-struct RequestContext : isc::util::nonassignable {
+struct B10_LIBACL_API RequestContext : isc::util::nonassignable {
     /// The constructor
     ///
     /// This is a trivial constructor that perform straightforward
@@ -118,7 +119,7 @@ typedef acl::Loader<RequestContext> RequestLoader;
  * one is enough, this one will have registered default checks and it
  * is known one, so any plugins can registrer additional checks as well.
  */
-RequestLoader& getRequestLoader();
+B10_LIBACL_API RequestLoader& getRequestLoader();
 
 // The following is essentially private to the implementation and could
 // be hidden in the implementation file.  But it's visible via this header
@@ -131,7 +132,8 @@ namespace internal {
 typedef isc::acl::IPCheck<RequestContext> RequestIPCheck;
 typedef isc::acl::dns::NameCheck<RequestContext> RequestKeyCheck;
 
-class RequestCheckCreator : public acl::Loader<RequestContext>::CheckCreator {
+class B10_LIBACL_API RequestCheckCreator :
+    public acl::Loader<RequestContext>::CheckCreator {
 public:
     virtual std::vector<std::string> names() const;
 
diff --git a/src/lib/acl/dnsname_check.h b/src/lib/acl/dnsname_check.h
index dac925e..e0ece5e 100644
--- a/src/lib/acl/dnsname_check.h
+++ b/src/lib/acl/dnsname_check.h
@@ -19,6 +19,7 @@
 
 #include <util/nonassignable.h>
 
+#include <acl/dll.h>
 #include <acl/check.h>
 
 namespace isc {
diff --git a/src/lib/acl/ip_check.cc b/src/lib/acl/ip_check.cc
index 7192064..60c6b6b 100644
--- a/src/lib/acl/ip_check.cc
+++ b/src/lib/acl/ip_check.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBACL_EXPORT
+
 #include <sys/types.h>
 #include <sys/socket.h>
 
diff --git a/src/lib/acl/ip_check.h b/src/lib/acl/ip_check.h
index 794b943..f1bbfbd 100644
--- a/src/lib/acl/ip_check.h
+++ b/src/lib/acl/ip_check.h
@@ -29,6 +29,7 @@
 #include <sys/socket.h> // for AF_INET/AF_INET6
 #include <netinet/in.h>
 
+#include <acl/dll.h>
 #include <acl/check.h>
 #include <exceptions/exceptions.h>
 #include <util/strutil.h>
@@ -57,7 +58,7 @@ namespace internal {
 ///
 /// \exception OutOfRange prefixlen is too large for the data type.
 
-uint8_t createMask(size_t prefixlen);
+B10_LIBACL_API uint8_t createMask(size_t prefixlen);
 
 /// \brief Split IP Address Prefix
 ///
@@ -78,7 +79,7 @@ uint8_t createMask(size_t prefixlen);
 ///
 /// \exception InvalidParameter Address prefix not of the expected syntax
 
-std::pair<std::string, int>
+B10_LIBACL_API std::pair<std::string, int>
 splitIPAddress(const std::string& ipprefix);
 
 } // namespace internal
@@ -108,7 +109,7 @@ splitIPAddress(const std::string& ipprefix);
 ///
 /// In future, we may introduce the default constructor to further improve
 /// reusability.
-struct IPAddress {
+struct B10_LIBACL_API IPAddress {
     /// The constructor from socket address structure.
     ///
     /// This constructor set up the internal data based on the actual type
diff --git a/src/lib/acl/loader.cc b/src/lib/acl/loader.cc
index 8ca7e28..b93b493 100644
--- a/src/lib/acl/loader.cc
+++ b/src/lib/acl/loader.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBACL_EXPORT
+
 #include "loader.h"
 
 using namespace std;
@@ -19,7 +21,8 @@ using namespace std;
 namespace isc {
 namespace acl {
 
-BasicAction defaultActionLoader(data::ConstElementPtr actionEl) {
+B10_LIBACL_API BasicAction
+defaultActionLoader(data::ConstElementPtr actionEl) {
     try {
         const string action(actionEl->stringValue());
         if (action == "ACCEPT") {
diff --git a/src/lib/acl/loader.h b/src/lib/acl/loader.h
index 99db72d..05618d8 100644
--- a/src/lib/acl/loader.h
+++ b/src/lib/acl/loader.h
@@ -17,6 +17,7 @@
 
 #include <util/nonassignable.h>
 #include <exceptions/exceptions.h>
+#include <acl/dll.h>
 #include <acl/acl.h>
 #include <cc/data.h>
 #include <boost/function.hpp>
@@ -26,8 +27,8 @@
 namespace isc {
 namespace acl {
 
-class AnyOfSpec;
-class AllOfSpec;
+class B10_LIBACL_API AnyOfSpec;
+class B10_LIBACL_API AllOfSpec;
 template<typename Mode, typename Context> class LogicOperator;
 
 /**
@@ -41,7 +42,7 @@ template<typename Mode, typename Context> class LogicOperator;
  *
  * Checks may subclass this exception for similar errors if they see it fit.
  */
-class LoaderError : public BadValue {
+class B10_LIBACL_API LoaderError : public BadValue {
 private:
     const data::ConstElementPtr element_;
 public:
@@ -86,7 +87,7 @@ public:
  *     and contain one of "ACCEPT", "REJECT" or "DROP.
  * \note We could define different names or add aliases if needed.
  */
-BasicAction defaultActionLoader(data::ConstElementPtr action);
+B10_LIBACL_API BasicAction defaultActionLoader(data::ConstElementPtr action);
 
 /**
  * \brief Loader of ACLs.
diff --git a/src/lib/acl/logic_check.h b/src/lib/acl/logic_check.h
index c519eae..f1ade4f 100644
--- a/src/lib/acl/logic_check.h
+++ b/src/lib/acl/logic_check.h
@@ -15,6 +15,7 @@
 #ifndef ACL_LOGIC_CHECK_H
 #define ACL_LOGIC_CHECK_H
 
+#include <acl/dll.h>
 #include "check.h"
 #include "loader.h"
 
@@ -22,7 +23,7 @@ namespace isc {
 namespace acl {
 
 /// \brief Constants for the AnyOf implementation
-class AnyOfSpec {
+class B10_LIBACL_API AnyOfSpec {
 public:
     static bool start() { return (false); }
     static bool terminate(const bool another) {
@@ -31,7 +32,7 @@ public:
 };
 
 /// \brief Constants for the AllOf implementation
-class AllOfSpec {
+class B10_LIBACL_API AllOfSpec {
 public:
     static bool start() { return (true); }
     static bool terminate(const bool another) {
diff --git a/src/lib/asiodns/Makefile.am b/src/lib/asiodns/Makefile.am
index 321de8b..922965a 100644
--- a/src/lib/asiodns/Makefile.am
+++ b/src/lib/asiodns/Makefile.am
@@ -17,7 +17,7 @@ asiodns_messages.h asiodns_messages.cc: asiodns_messages.mes
 BUILT_SOURCES = asiodns_messages.h asiodns_messages.cc
 
 lib_LTLIBRARIES = libb10-asiodns.la
-libb10_asiodns_la_SOURCES = dns_answer.h
+libb10_asiodns_la_SOURCES = dll.h dns_answer.h
 libb10_asiodns_la_SOURCES += asiodns.h
 libb10_asiodns_la_SOURCES += dns_lookup.h
 libb10_asiodns_la_SOURCES += dns_server.h
diff --git a/src/lib/asiodns/asiodns.h b/src/lib/asiodns/asiodns.h
index 8791a72..79816ef 100644
--- a/src/lib/asiodns/asiodns.h
+++ b/src/lib/asiodns/asiodns.h
@@ -15,6 +15,7 @@
 #ifndef __ASIODNS_H
 #define __ASIODNS_H 1
 
+#include <asiodns/dll.h>
 #include <asiodns/dns_service.h>
 #include <asiodns/dns_server.h>
 #include <asiodns/dns_lookup.h>
diff --git a/src/lib/asiodns/dll.h b/src/lib/asiodns/dll.h
new file mode 100644
index 0000000..d8ab693
--- /dev/null
+++ b/src/lib/asiodns/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBASIODNS_H
+#define __LIBASIODNS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBASIODNS_API
+#else
+#ifdef B10_LIBASIODNS_EXPORT
+#define B10_LIBASIODNS_API __declspec(dllexport)
+#else
+#define B10_LIBASIODNS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBASIODNS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/asiodns/dns_answer.h b/src/lib/asiodns/dns_answer.h
index 8905282..3eff28d 100644
--- a/src/lib/asiodns/dns_answer.h
+++ b/src/lib/asiodns/dns_answer.h
@@ -19,6 +19,7 @@
 #include <util/buffer.h>
 #include <util/noncopyable.h>
 #include <dns/message.h>
+#include <asiodns/dll.h>
 
 namespace isc {
 namespace asiodns {
@@ -36,7 +37,7 @@ namespace asiodns {
 /// from a DNS Lookup provider functon and readies it to be sent to the
 /// client.  After it has run, the OutputBuffer object passed to it should
 /// contain the answer to the query rendered into wire format.
-class DNSAnswer : isc::util::noncopyable {
+class B10_LIBASIODNS_API DNSAnswer : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiodns/dns_lookup.h b/src/lib/asiodns/dns_lookup.h
index 7e7f175..f4c7862 100644
--- a/src/lib/asiodns/dns_lookup.h
+++ b/src/lib/asiodns/dns_lookup.h
@@ -16,6 +16,7 @@
 #define __ASIOLINK_DNS_LOOKUP_H 1
 
 #include <asiolink/io_message.h>
+#include <asiodns/dll.h>
 #include <asiodns/dns_server.h>
 #include <dns/message.h>
 #include <util/buffer.h>
@@ -37,7 +38,7 @@ namespace asiodns {
 /// a DNS query (e.g., from authoritative data source, cache, or upstream
 /// query).  After it has run, the OutputBuffer object passed to it
 /// should contain the answer to the query, in an internal representation.
-class DNSLookup : isc::util::noncopyable {
+class B10_LIBASIODNS_API DNSLookup : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiodns/dns_server.h b/src/lib/asiodns/dns_server.h
index 157307d..750f22d 100644
--- a/src/lib/asiodns/dns_server.h
+++ b/src/lib/asiodns/dns_server.h
@@ -17,6 +17,7 @@
 
 #include <util/nonassignable.h>
 #include <asiolink/io_message.h>
+#include <asiodns/dll.h>
 
 namespace isc {
 namespace asiodns {
@@ -46,7 +47,7 @@ namespace asiodns {
 ///
 /// Because these objects are frequently copied, it is recommended
 /// that derived classes be kept small to reduce copy overhead.
-class DNSServer {
+class B10_LIBASIODNS_API DNSServer {
 protected:
     ///
     /// \name Constructors and destructors
diff --git a/src/lib/asiodns/dns_service.cc b/src/lib/asiodns/dns_service.cc
index 8b30801..f5383da 100644
--- a/src/lib/asiodns/dns_service.cc
+++ b/src/lib/asiodns/dns_service.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <config.h>
 
 #include <util/nonassignable.h>
@@ -34,8 +36,8 @@ using namespace isc::asiolink;
 namespace isc {
 namespace asiodns {
 
-class DNSLookup;
-class DNSAnswer;
+class B10_LIBASIODNS_API DNSLookup;
+class B10_LIBASIODNS_API DNSAnswer;
 
 class DNSServiceImpl : isc::util::nonassignable {
 public:
diff --git a/src/lib/asiodns/dns_service.h b/src/lib/asiodns/dns_service.h
index a2a188e..0afdc13 100644
--- a/src/lib/asiodns/dns_service.h
+++ b/src/lib/asiodns/dns_service.h
@@ -22,11 +22,13 @@
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
 
+#include <asiodns/dll.h>
+
 namespace isc {
 namespace asiodns {
 
-class DNSLookup;
-class DNSAnswer;
+class B10_LIBASIODNS_API DNSLookup;
+class B10_LIBASIODNS_API DNSAnswer;
 class DNSServiceImpl;
 
 /// \brief A base class for common \c DNSService interfaces.
@@ -40,7 +42,7 @@ class DNSServiceImpl;
 /// For this reason most of the detailed description are given in the
 /// \c DNSService class.  See that for further details of specific methods
 /// and class behaviors.
-class DNSServiceBase {
+class B10_LIBASIODNS_API DNSServiceBase {
 protected:
     /// \brief Default constructor.
     ///
@@ -96,7 +98,9 @@ public:
 /// logic that is shared between the authoritative and the recursive
 /// server implementations. As such, it handles asio, including config
 /// updates (through the 'Checkinprovider'), and listening sockets.
-class DNSService : isc::util::noncopyable, public DNSServiceBase {
+class B10_LIBASIODNS_API DNSService :
+    isc::util::noncopyable, public DNSServiceBase
+{
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiodns/io_fetch.cc b/src/lib/asiodns/io_fetch.cc
index eed5fdf..979aebc 100644
--- a/src/lib/asiodns/io_fetch.cc
+++ b/src/lib/asiodns/io_fetch.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <config.h>
 
 #include <unistd.h>             // for some IPC/network system calls
diff --git a/src/lib/asiodns/io_fetch.h b/src/lib/asiodns/io_fetch.h
index 78c2da9..4141ec8 100644
--- a/src/lib/asiodns/io_fetch.h
+++ b/src/lib/asiodns/io_fetch.h
@@ -26,6 +26,7 @@
 #include <asio/error_code.hpp>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
+#include <asiodns/dll.h>
 
 #include <util/buffer.h>
 #include <dns/question.h>
@@ -43,7 +44,7 @@ struct IOFetchData;
 ///
 /// \param E Endpoint type to use.
 
-class IOFetch : public coroutine {
+class B10_LIBASIODNS_API IOFetch : public coroutine {
 public:
     /// \brief Protocol to use on the fetch
     enum Protocol {
diff --git a/src/lib/asiodns/logger.cc b/src/lib/asiodns/logger.cc
index 5801a0b..0b8ec43 100644
--- a/src/lib/asiodns/logger.cc
+++ b/src/lib/asiodns/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <asiodns/logger.h>
 
 namespace isc {
diff --git a/src/lib/asiodns/logger.h b/src/lib/asiodns/logger.h
index 306d463..b4ff03a 100644
--- a/src/lib/asiodns/logger.h
+++ b/src/lib/asiodns/logger.h
@@ -15,6 +15,7 @@
 #include <log/logger.h>
 #include <log/macros.h>
 #include <log/log_dbglevels.h>
+#include <asiodns/dll.h>
 #include <asiodns/asiodns_messages.h>
 
 namespace isc {
diff --git a/src/lib/asiodns/sync_udp_server.cc b/src/lib/asiodns/sync_udp_server.cc
index a31301d..8a7fec5 100644
--- a/src/lib/asiodns/sync_udp_server.cc
+++ b/src/lib/asiodns/sync_udp_server.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <config.h>
 
 #include <asio.hpp>
diff --git a/src/lib/asiodns/sync_udp_server.h b/src/lib/asiodns/sync_udp_server.h
index 71b0780..1d48192 100644
--- a/src/lib/asiodns/sync_udp_server.h
+++ b/src/lib/asiodns/sync_udp_server.h
@@ -23,6 +23,7 @@
 #include "dns_lookup.h"
 #include "dns_server.h"
 
+#include <asiodns/dll.h>
 #include <dns/message.h>
 #include <asiolink/simple_callback.h>
 #include <util/buffer.h>
@@ -39,7 +40,8 @@ namespace asiodns {
 /// That means, the lookup handler must provide the answer right away.
 /// This allows for implementation with less overhead, compared with
 /// the UDPClass.
-class SyncUDPServer : public DNSServer, public isc::util::noncopyable {
+class B10_LIBASIODNS_API SyncUDPServer :
+    public DNSServer, public isc::util::noncopyable {
 public:
     /// \brief Constructor
     /// \param io_service the asio::io_service to work with
diff --git a/src/lib/asiodns/tcp_server.cc b/src/lib/asiodns/tcp_server.cc
index 8e4b4d6..4fc501a 100644
--- a/src/lib/asiodns/tcp_server.cc
+++ b/src/lib/asiodns/tcp_server.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <config.h>
 
 #include <unistd.h>             // for some IPC/network system calls
diff --git a/src/lib/asiodns/udp_server.cc b/src/lib/asiodns/udp_server.cc
index a6d913f..a3a1521 100644
--- a/src/lib/asiodns/udp_server.cc
+++ b/src/lib/asiodns/udp_server.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIODNS_EXPORT
+
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
 #include <sys/socket.h>
diff --git a/src/lib/asiodns/udp_server.h b/src/lib/asiodns/udp_server.h
index b32c06c..a8dc349 100644
--- a/src/lib/asiodns/udp_server.h
+++ b/src/lib/asiodns/udp_server.h
@@ -20,6 +20,7 @@
 #endif
 
 #include <asiolink/simple_callback.h>
+#include <asiodns/dll.h>
 #include <asiodns/dns_answer.h>
 #include <asiodns/dns_lookup.h>
 #include <asiodns/dns_server.h>
@@ -37,7 +38,8 @@ namespace asiodns {
 ///        DNS query event. As such, it is both a \c DNSServer and
 ///        a \c coroutine
 ///
-class UDPServer : public virtual DNSServer, public virtual coroutine {
+class B10_LIBASIODNS_API UDPServer :
+    public virtual DNSServer, public virtual coroutine {
 public:
     /// \brief Constructor
     /// \param io_service the asio::io_service to work with
diff --git a/src/lib/asiolink/Makefile.am b/src/lib/asiolink/Makefile.am
index 3505982..e66bf56 100644
--- a/src/lib/asiolink/Makefile.am
+++ b/src/lib/asiolink/Makefile.am
@@ -17,17 +17,17 @@ lib_LTLIBRARIES = libb10-asiolink.la
 
 libb10_asiolink_la_LDFLAGS = -no-undefined -version-info 1:0:1
 
-libb10_asiolink_la_SOURCES  = asiolink.h
-libb10_asiolink_la_SOURCES += dummy_io_cb.h
+libb10_asiolink_la_SOURCES  = dll.h asiolink.h
+libb10_asiolink_la_SOURCES += dummy_io_cb.cc dummy_io_cb.h
 libb10_asiolink_la_SOURCES += interval_timer.cc interval_timer.h
 libb10_asiolink_la_SOURCES += io_address.cc io_address.h
 libb10_asiolink_la_SOURCES += io_asio_socket.h
 libb10_asiolink_la_SOURCES += io_endpoint.cc io_endpoint.h
-libb10_asiolink_la_SOURCES += io_error.h
-libb10_asiolink_la_SOURCES += io_message.h
+libb10_asiolink_la_SOURCES += io_error.cc io_error.h
+libb10_asiolink_la_SOURCES += io_message.cc io_message.h
 libb10_asiolink_la_SOURCES += io_service.h io_service.cc
 libb10_asiolink_la_SOURCES += io_socket.h io_socket.cc
-libb10_asiolink_la_SOURCES += simple_callback.h
+libb10_asiolink_la_SOURCES += simple_callback.cc simple_callback.h
 libb10_asiolink_la_SOURCES += tcp_endpoint.h
 libb10_asiolink_la_SOURCES += tcp_socket.h
 libb10_asiolink_la_SOURCES += udp_endpoint.h
diff --git a/src/lib/asiolink/asiolink.h b/src/lib/asiolink/asiolink.h
index 51d3a14..795cc66 100644
--- a/src/lib/asiolink/asiolink.h
+++ b/src/lib/asiolink/asiolink.h
@@ -19,6 +19,8 @@
 // this file.  In particular, asio.hpp should never be included here.
 // See the description of the namespace below.
 
+#include <asiolink/dll.h>
+
 #include <asiolink/io_service.h>
 #include <asiolink/simple_callback.h>
 #include <asiolink/interval_timer.h>
diff --git a/src/lib/asiolink/dll.h b/src/lib/asiolink/dll.h
new file mode 100644
index 0000000..6b90e0a
--- /dev/null
+++ b/src/lib/asiolink/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBASIOLINK_H
+#define __LIBASIOLINK_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBASIOLINK_API
+#else
+#ifdef B10_LIBASIOLINK_EXPORT
+#define B10_LIBASIOLINK_API __declspec(dllexport)
+#else
+#define B10_LIBASIOLINK_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBASIOLINK_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/asiolink/dummy_io_cb.cc b/src/lib/asiolink/dummy_io_cb.cc
new file mode 100644
index 0000000..7bb0a8c
--- /dev/null
+++ b/src/lib/asiolink/dummy_io_cb.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/dummy_io_cb.h>
+
+// Instantiate class
+
+class B10_LIBASIOLINK_API DummyIOCallback;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/dummy_io_cb.h b/src/lib/asiolink/dummy_io_cb.h
index bcaefe9..6290bf9 100644
--- a/src/lib/asiolink/dummy_io_cb.h
+++ b/src/lib/asiolink/dummy_io_cb.h
@@ -19,6 +19,7 @@
 
 #include <asio/error.hpp>
 #include <asio/error_code.hpp>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
@@ -34,7 +35,7 @@ namespace asiolink {
 /// template parameter.  This is the reason for this class - it is the dummy
 /// template parameter.
 
-class DummyIOCallback {
+class B10_LIBASIOLINK_API DummyIOCallback {
 public:
 
     /// \brief Asynchronous I/O callback method
diff --git a/src/lib/asiolink/interval_timer.cc b/src/lib/asiolink/interval_timer.cc
index 214ca01..6ef8d72 100644
--- a/src/lib/asiolink/interval_timer.cc
+++ b/src/lib/asiolink/interval_timer.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
 #include <boost/bind.hpp>
diff --git a/src/lib/asiolink/interval_timer.h b/src/lib/asiolink/interval_timer.h
index aae4289..526dcd6 100644
--- a/src/lib/asiolink/interval_timer.h
+++ b/src/lib/asiolink/interval_timer.h
@@ -20,6 +20,7 @@
 
 #include <util/noncopyable.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_service.h>
 
 namespace isc {
@@ -57,7 +58,7 @@ class IntervalTimerImpl;
 ///  intervalTimer.setup(function_to_call_back, interval_in_milliseconds);
 ///  io_service.run();
 /// \endcode
-class IntervalTimer : isc::util::noncopyable {
+class B10_LIBASIOLINK_API IntervalTimer : isc::util::noncopyable {
 public:
     /// \name The type of timer callback function
     typedef boost::function<void()> Callback;
diff --git a/src/lib/asiolink/io_address.cc b/src/lib/asiolink/io_address.cc
index 832452c..8444f36 100644
--- a/src/lib/asiolink/io_address.cc
+++ b/src/lib/asiolink/io_address.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
 #include <unistd.h>             // for some IPC/network system calls
diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h
index c40e5b9..dd8fcb7 100644
--- a/src/lib/asiolink/io_address.h
+++ b/src/lib/asiolink/io_address.h
@@ -26,6 +26,7 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
@@ -40,7 +41,7 @@ namespace asiolink {
 /// agnostic)
 ///
 /// This class is a wrapper for the ASIO \c ip::address class.
-class IOAddress {
+class B10_LIBASIOLINK_API IOAddress {
 public:
     ///
     /// \name Constructors and Destructor
diff --git a/src/lib/asiolink/io_asio_socket.h b/src/lib/asiolink/io_asio_socket.h
index 8cb8891..e2e265f 100644
--- a/src/lib/asiolink/io_asio_socket.h
+++ b/src/lib/asiolink/io_asio_socket.h
@@ -28,6 +28,7 @@
 
 #include <util/buffer.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_error.h>
 #include <asiolink/io_socket.h>
 
@@ -37,7 +38,7 @@ namespace asiolink {
 /// \brief Socket not open
 ///
 /// Thrown on an attempt to do read/write to a socket that is not open.
-class SocketNotOpen : public IOError {
+class B10_LIBASIOLINK_API SocketNotOpen : public IOError {
 public:
     SocketNotOpen(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
@@ -46,7 +47,7 @@ public:
 /// \brief Error setting socket options
 ///
 /// Thrown if attempt to change socket options fails.
-class SocketSetError : public IOError {
+class B10_LIBASIOLINK_API SocketSetError : public IOError {
 public:
     SocketSetError(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
@@ -56,14 +57,14 @@ public:
 ///
 /// Thrown if an attempt is made to receive into an area beyond the end of
 /// the receive data buffer.
-class BufferOverflow : public IOError {
+class B10_LIBASIOLINK_API BufferOverflow : public IOError {
 public:
     BufferOverflow(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
 };
 
 /// Forward declaration of an IOEndpoint
-class IOEndpoint;
+class B10_LIBASIOLINK_API IOEndpoint;
 
 
 /// \brief I/O Socket with asynchronous operations
diff --git a/src/lib/asiolink/io_endpoint.cc b/src/lib/asiolink/io_endpoint.cc
index 2354521..4c3ce52 100644
--- a/src/lib/asiolink/io_endpoint.cc
+++ b/src/lib/asiolink/io_endpoint.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
 #include <asio.hpp>
@@ -61,7 +63,7 @@ IOEndpoint::operator!=(const IOEndpoint& other) const {
     return (!operator==(other));
 }
 
-ostream&
+B10_LIBASIOLINK_API ostream&
 operator<<(ostream& os, const IOEndpoint& endpoint) {
     if (endpoint.getFamily() == AF_INET6) {
         os << "[" << endpoint.getAddress().toText() << "]";
diff --git a/src/lib/asiolink/io_endpoint.h b/src/lib/asiolink/io_endpoint.h
index 07c5337..ede72ac 100644
--- a/src/lib/asiolink/io_endpoint.h
+++ b/src/lib/asiolink/io_endpoint.h
@@ -24,6 +24,7 @@
 
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
+#include <asiolink/dll.h>
 #include <asiolink/io_address.h>
 
 # include <ostream>
@@ -44,7 +45,7 @@ namespace asiolink {
 /// Derived class implementations are completely hidden within the
 /// implementation.  User applications only get access to concrete
 /// \c IOEndpoint objects via the abstract interfaces.
-class IOEndpoint : isc::util::noncopyable {
+class B10_LIBASIOLINK_API IOEndpoint : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
@@ -177,7 +178,8 @@ public:
 /// operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const IOEndpoint& endpoint);
+B10_LIBASIOLINK_API std::ostream&
+operator<<(std::ostream& os, const IOEndpoint& endpoint);
 } // namespace asiolink
 } // namespace isc
 #endif // __IO_ENDPOINT_H
diff --git a/src/lib/asiolink/io_error.cc b/src/lib/asiolink/io_error.cc
new file mode 100644
index 0000000..92f5357
--- /dev/null
+++ b/src/lib/asiolink/io_error.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asio.hpp>
+
+#include <asiolink/io_asio_socket.h>
+#include <asiolink/tcp_socket.h>
+
+// Instantiate classes
+
+class B10_LIBASIOLINK_API SocketNotOpen;
+class B10_LIBASIOLINK_API SocketSetError;
+class B10_LIBASIOLINK_API BufferOverflow;
+class B10_LIBASIOLINK_API BufferTooLarge;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/io_error.h b/src/lib/asiolink/io_error.h
index c19d91c..210bd30 100644
--- a/src/lib/asiolink/io_error.h
+++ b/src/lib/asiolink/io_error.h
@@ -17,6 +17,7 @@
 #define __IO_ERROR_H
 
 #include <exceptions/exceptions.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
@@ -24,7 +25,7 @@ namespace asiolink {
 /// \brief An exception that is thrown if an error occurs within the IO
 /// module.  This is mainly intended to be a wrapper exception class for
 /// ASIO specific exceptions.
-class IOError : public isc::Exception {
+class B10_LIBASIOLINK_API IOError : public isc::Exception {
 public:
     IOError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
diff --git a/src/lib/asiolink/io_message.cc b/src/lib/asiolink/io_message.cc
new file mode 100644
index 0000000..e0a48fe
--- /dev/null
+++ b/src/lib/asiolink/io_message.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/io_message.h>
+
+// Instantiate class
+
+class B10_LIBASIOLINK_API IOMessage;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/io_message.h b/src/lib/asiolink/io_message.h
index 76741cd..cb7e79d 100644
--- a/src/lib/asiolink/io_message.h
+++ b/src/lib/asiolink/io_message.h
@@ -27,6 +27,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_socket.h>
 
@@ -45,7 +46,7 @@ namespace asiolink {
 /// It only provides a minimal level of support that is necessary for
 /// the current implementation of the authoritative server.
 /// A future version of this class will definitely support more.
-class IOMessage : isc::util::noncopyable {
+class B10_LIBASIOLINK_API IOMessage : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/io_service.cc b/src/lib/asiolink/io_service.cc
index b9999da..0d60238 100644
--- a/src/lib/asiolink/io_service.cc
+++ b/src/lib/asiolink/io_service.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIOLINK_EXPORT
+
 #include <config.h>
 
 #include <unistd.h>             // for some IPC/network system calls
diff --git a/src/lib/asiolink/io_service.h b/src/lib/asiolink/io_service.h
index 1e85ea6..9dbd070 100644
--- a/src/lib/asiolink/io_service.h
+++ b/src/lib/asiolink/io_service.h
@@ -17,6 +17,8 @@
 
 #include <util/noncopyable.h>
 
+#include <asiolink/dll.h>
+
 namespace asio {
     class io_service;
 }
@@ -29,7 +31,7 @@ class IOServiceImpl;
 /// \brief The \c IOService class is a wrapper for the ASIO \c io_service
 /// class.
 ///
-class IOService : isc::util::noncopyable {
+class B10_LIBASIOLINK_API IOService : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/io_socket.cc b/src/lib/asiolink/io_socket.cc
index e6b7dde..0234bbe 100644
--- a/src/lib/asiolink/io_socket.cc
+++ b/src/lib/asiolink/io_socket.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBASIOLINK_EXPORT
+
 #include "io_socket.h"
 
 #include <asio.hpp>
diff --git a/src/lib/asiolink/io_socket.h b/src/lib/asiolink/io_socket.h
index 5ff0354..d17f76d 100644
--- a/src/lib/asiolink/io_socket.h
+++ b/src/lib/asiolink/io_socket.h
@@ -24,8 +24,8 @@
 #include <string>
 
 #include <util/noncopyable.h>
-
 #include <exceptions/exceptions.h>
+#include <asiolink/dll.h>
 
 namespace isc {
 namespace asiolink {
@@ -44,7 +44,7 @@ namespace asiolink {
 /// modules use it.  Also, at that point we may define a separate (visible)
 /// derived class for testing purposes rather than providing factory methods
 /// (i.e., getDummy variants below).
-class IOSocket : isc::util::noncopyable {
+class B10_LIBASIOLINK_API IOSocket : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/simple_callback.cc b/src/lib/asiolink/simple_callback.cc
new file mode 100644
index 0000000..0e704a8
--- /dev/null
+++ b/src/lib/asiolink/simple_callback.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBASIOLINK_EXPORT
+
+#include <config.h>
+
+#include <asiolink/simple_callback.h>
+
+// Instantiate class
+
+class B10_LIBASIOLINK_API SimpleCallback;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/asiolink/simple_callback.h b/src/lib/asiolink/simple_callback.h
index df5b054..0b229ad 100644
--- a/src/lib/asiolink/simple_callback.h
+++ b/src/lib/asiolink/simple_callback.h
@@ -17,6 +17,7 @@
 
 #include <util/noncopyable.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_message.h>
 
 namespace isc {
@@ -36,7 +37,7 @@ namespace asiolink {
 /// The \c SimpleCallback is expected to be used for basic, generic
 /// tasks such as checking for configuration changes.  It may also be
 /// used for testing purposes.
-class SimpleCallback : isc::util::noncopyable {
+class B10_LIBASIOLINK_API SimpleCallback : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/asiolink/tcp_endpoint.h b/src/lib/asiolink/tcp_endpoint.h
index a54f6b2..e2253c2 100644
--- a/src/lib/asiolink/tcp_endpoint.h
+++ b/src/lib/asiolink/tcp_endpoint.h
@@ -19,6 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
@@ -28,7 +29,7 @@ namespace asiolink {
 /// \c IOEndpoint that represents an endpoint of a TCP packet.
 ///
 /// Other notes about \c TCPEndpoint applies to this class, too.
-class TCPEndpoint : public IOEndpoint {
+class B10_LIBASIOLINK_API TCPEndpoint : public IOEndpoint {
 public:
     ///
     /// \name Constructors and Destructor.
diff --git a/src/lib/asiolink/tcp_socket.h b/src/lib/asiolink/tcp_socket.h
index e998ad5..b996256 100644
--- a/src/lib/asiolink/tcp_socket.h
+++ b/src/lib/asiolink/tcp_socket.h
@@ -36,6 +36,7 @@
 #include <util/buffer.h>
 #include <util/io_utilities.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
@@ -47,7 +48,7 @@ namespace asiolink {
 /// \brief Buffer Too Large
 ///
 /// Thrown on an attempt to send a buffer > 64k
-class BufferTooLarge : public IOError {
+class B10_LIBASIOLINK_API BufferTooLarge : public IOError {
 public:
     BufferTooLarge(const char* file, size_t line, const char* what) :
         IOError(file, line, what) {}
diff --git a/src/lib/asiolink/udp_endpoint.h b/src/lib/asiolink/udp_endpoint.h
index c5ba3bd..d7dbf5c 100644
--- a/src/lib/asiolink/udp_endpoint.h
+++ b/src/lib/asiolink/udp_endpoint.h
@@ -19,6 +19,7 @@
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
+#include <asiolink/dll.h>
 #include <asiolink/io_endpoint.h>
 
 namespace isc {
@@ -28,7 +29,7 @@ namespace asiolink {
 /// \c IOEndpoint that represents an endpoint of a UDP packet.
 ///
 /// Other notes about \c TCPEndpoint applies to this class, too.
-class UDPEndpoint : public IOEndpoint {
+class B10_LIBASIOLINK_API UDPEndpoint : public IOEndpoint {
 public:
     ///
     /// \name Constructors and Destructor.
diff --git a/src/lib/asiolink/udp_socket.h b/src/lib/asiolink/udp_socket.h
index c5f949f..ed89a95 100644
--- a/src/lib/asiolink/udp_socket.h
+++ b/src/lib/asiolink/udp_socket.h
@@ -28,6 +28,7 @@
 
 #include <config.h>
 
+#include <asiolink/dll.h>
 #include <asiolink/io_asio_socket.h>
 #include <asiolink/io_endpoint.h>
 #include <asiolink/io_service.h>
diff --git a/src/lib/bench/Makefile.am b/src/lib/bench/Makefile.am
index b4e1856..17eaf53 100644
--- a/src/lib/bench/Makefile.am
+++ b/src/lib/bench/Makefile.am
@@ -7,5 +7,5 @@ AM_CXXFLAGS = $(B10_CXXFLAGS)
 CLEANFILES = *.gcno *.gcda
 
 noinst_LTLIBRARIES = libb10-bench.la
-libb10_bench_la_SOURCES = benchmark_util.h benchmark_util.cc
+libb10_bench_la_SOURCES = dll.h benchmark_util.h benchmark_util.cc
 EXTRA_DIST = benchmark.h
diff --git a/src/lib/bench/benchmark.h b/src/lib/bench/benchmark.h
index 97376e0..d664fc4 100644
--- a/src/lib/bench/benchmark.h
+++ b/src/lib/bench/benchmark.h
@@ -22,6 +22,7 @@
 #include <ios>
 
 #include <util/noncopyable.h>
+#include <bench/dll.h>
 
 namespace isc {
 namespace bench {
diff --git a/src/lib/bench/benchmark_util.cc b/src/lib/bench/benchmark_util.cc
index 34356c8..0fa6e08 100644
--- a/src/lib/bench/benchmark_util.cc
+++ b/src/lib/bench/benchmark_util.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBBENCH_EXPORT
+
 #include <fstream>
 #include <iostream>
 #include <string>
@@ -39,7 +41,7 @@ using namespace isc::util;
 
 namespace isc {
 namespace bench {
-void
+B10_LIBBENCH_API void
 loadQueryData(const char* const input_file, BenchQueries& queries,
               const RRClass& qclass, const bool strict)
 {
@@ -54,7 +56,7 @@ loadQueryData(const char* const input_file, BenchQueries& queries,
     ifs.close();
 }
 
-void
+B10_LIBBENCH_API void
 loadQueryData(istream& input, BenchQueries& queries, const RRClass& qclass,
               const bool strict)
 {
diff --git a/src/lib/bench/benchmark_util.h b/src/lib/bench/benchmark_util.h
index 3a373f2..6bf706d 100644
--- a/src/lib/bench/benchmark_util.h
+++ b/src/lib/bench/benchmark_util.h
@@ -31,16 +31,17 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
+#include <bench/dll.h>
 
 namespace isc {
 namespace dns {
-class RRClass;
+class B10_LIBBENCH_API RRClass;
 }
 
 namespace bench {
 /// \brief An exception that is thrown if an error occurs within the benchmark
 /// module.
-class BenchMarkError : public Exception {
+class B10_LIBBENCH_API BenchMarkError : public Exception {
 public:
     BenchMarkError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -108,8 +109,9 @@ typedef std::vector<std::vector<unsigned char> > BenchQueries;
 /// is used for all queries.
 /// \param strict If \c true, apply stricter validation on the query name and
 /// query RR types; otherwise invalid inputs will be ignored.
-void loadQueryData(const char* const input_file, BenchQueries& queries,
-                   const isc::dns::RRClass& qclass, const bool strict = false);
+B10_LIBBENCH_API void
+loadQueryData(const char* const input_file, BenchQueries& queries,
+              const isc::dns::RRClass& qclass, const bool strict = false);
 
 /// \brief Load query %data from an input stream into a vector.
 ///
@@ -136,8 +138,9 @@ void loadQueryData(const char* const input_file, BenchQueries& queries,
 /// is used for all queries.
 /// \param strict If \c true, apply stricter validation on the query name and
 /// query RR types; otherwise invalid inputs will be ignored.
-void loadQueryData(std::istream& input, BenchQueries& queries,
-                   const isc::dns::RRClass& qclass, const bool strict = false);
+B10_LIBBENCH_API void
+loadQueryData(std::istream& input, BenchQueries& queries,
+              const isc::dns::RRClass& qclass, const bool strict = false);
 }
 }
 #endif  // __BENCHMARK_UTIL_H
diff --git a/src/lib/bench/dll.h b/src/lib/bench/dll.h
new file mode 100644
index 0000000..3018e67
--- /dev/null
+++ b/src/lib/bench/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBBENCH_H
+#define __LIBBENCH_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBBENCH_API
+#else
+#ifdef B10_LIBBENCH_EXPORT
+#define B10_LIBBENCH_API __declspec(dllexport)
+#else
+#define B10_LIBBENCH_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBBENCH_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/cache/Makefile.am b/src/lib/cache/Makefile.am
index 00ca16e..c890ff8 100644
--- a/src/lib/cache/Makefile.am
+++ b/src/lib/cache/Makefile.am
@@ -22,7 +22,8 @@ AM_CXXFLAGS += -Wno-unused-parameter
 endif
 
 lib_LTLIBRARIES = libb10-cache.la
-libb10_cache_la_SOURCES  = resolver_cache.h resolver_cache.cc
+libb10_cache_la_SOURCES  = dll.h
+libb10_cache_la_SOURCES  += resolver_cache.h resolver_cache.cc
 libb10_cache_la_SOURCES  += message_cache.h message_cache.cc
 libb10_cache_la_SOURCES  += message_entry.h message_entry.cc
 libb10_cache_la_SOURCES  += rrset_cache.h rrset_cache.cc
diff --git a/src/lib/cache/cache_entry_key.cc b/src/lib/cache/cache_entry_key.cc
index 85c03a0..35df7ea 100644
--- a/src/lib/cache/cache_entry_key.cc
+++ b/src/lib/cache/cache_entry_key.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <sstream>
 #include "cache_entry_key.h"
 
@@ -19,7 +21,7 @@ using namespace std;
 
 namespace isc {
 namespace cache {
-const std::string
+B10_LIBCACHE_API const std::string
 genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type) {
     std::string keystr = name.toText();
     ostringstream stream;
@@ -28,7 +30,7 @@ genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type) {
     return (keystr);
 }
 
-const std::string
+B10_LIBCACHE_API const std::string
 genCacheEntryName(const std::string& namestr, const uint16_t type) {
     std::string keystr = namestr;
     ostringstream stream;
diff --git a/src/lib/cache/cache_entry_key.h b/src/lib/cache/cache_entry_key.h
index 674deb0..53772c7 100644
--- a/src/lib/cache/cache_entry_key.h
+++ b/src/lib/cache/cache_entry_key.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <dns/name.h>
 #include <dns/rrtype.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
@@ -36,7 +37,7 @@ namespace cache {
 /// \param name The Name to create a text entry for
 /// \param type The RRType to create a text entry for
 /// \return return the entry name.
-const std::string
+B10_LIBCACHE_API const std::string
 genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type);
 
 ///
@@ -44,7 +45,7 @@ genCacheEntryName(const isc::dns::Name& name, const isc::dns::RRType& type);
 ///
 /// \param namestr A string representation of a DNS Name
 /// \param type The value of a DNS RRType
-const std::string
+B10_LIBCACHE_API const std::string
 genCacheEntryName(const std::string& namestr, const uint16_t type);
 
 } // namespace cache
diff --git a/src/lib/cache/dll.h b/src/lib/cache/dll.h
new file mode 100644
index 0000000..3fc247f
--- /dev/null
+++ b/src/lib/cache/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCACHE_H
+#define __LIBCACHE_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBCACHE_API
+#else
+#ifdef B10_LIBCACHE_EXPORT
+#define B10_LIBCACHE_API __declspec(dllexport)
+#else
+#define B10_LIBCACHE_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCACHE_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/cache/local_zone_data.cc b/src/lib/cache/local_zone_data.cc
index 29ab2bf..d753103 100644
--- a/src/lib/cache/local_zone_data.cc
+++ b/src/lib/cache/local_zone_data.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <dns/rrset.h>
 #include "local_zone_data.h"
 #include "cache_entry_key.h"
diff --git a/src/lib/cache/local_zone_data.h b/src/lib/cache/local_zone_data.h
index df77f40..2459986 100644
--- a/src/lib/cache/local_zone_data.h
+++ b/src/lib/cache/local_zone_data.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <dns/rrset.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
@@ -27,7 +28,7 @@ namespace cache {
 /// The object of LocalZoneData represents the data of one
 /// local zone. It provides the interface for lookup the rrsets
 /// in the zone.
-class LocalZoneData {
+class B10_LIBCACHE_API LocalZoneData {
 public:
     LocalZoneData(uint16_t rrset_class) : class_(rrset_class)
     {}
diff --git a/src/lib/cache/logger.cc b/src/lib/cache/logger.cc
index f4b0f25..182c638 100644
--- a/src/lib/cache/logger.cc
+++ b/src/lib/cache/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <cache/logger.h>
 
 namespace isc {
diff --git a/src/lib/cache/logger.h b/src/lib/cache/logger.h
index 52c9743..dc6a00c 100644
--- a/src/lib/cache/logger.h
+++ b/src/lib/cache/logger.h
@@ -16,6 +16,7 @@
 #define __DATASRC_LOGGER_H
 
 #include <log/macros.h>
+#include <cache/dll.h>
 #include <cache/cache_messages.h>
 
 /// \file cache/logger.h
diff --git a/src/lib/cache/message_cache.cc b/src/lib/cache/message_cache.cc
index e141bb5..a9473ee 100644
--- a/src/lib/cache/message_cache.cc
+++ b/src/lib/cache/message_cache.cc
@@ -13,6 +13,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include <nsas/nsas_entry_compare.h>
diff --git a/src/lib/cache/message_cache.h b/src/lib/cache/message_cache.h
index ce6e9f5..fda918e 100644
--- a/src/lib/cache/message_cache.h
+++ b/src/lib/cache/message_cache.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <boost/shared_ptr.hpp>
 #include <dns/message.h>
+#include <cache/dll.h>
 #include "message_entry.h"
 #include <nsas/hash_table.h>
 #include <util/lru_list.h>
@@ -33,7 +34,7 @@ namespace cache {
 ///
 /// \todo The message cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class MessageCache : isc::util::noncopyable {
+class B10_LIBCACHE_API MessageCache : isc::util::noncopyable {
 public:
     /// \param rrset_cache The cache that stores the RRsets that the
     ///        message entry will point to
diff --git a/src/lib/cache/message_entry.cc b/src/lib/cache/message_entry.cc
index d9560a6..bea09e2 100644
--- a/src/lib/cache/message_entry.cc
+++ b/src/lib/cache/message_entry.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include <limits>
diff --git a/src/lib/cache/message_entry.h b/src/lib/cache/message_entry.h
index f9529bb..2f955c7 100644
--- a/src/lib/cache/message_entry.h
+++ b/src/lib/cache/message_entry.h
@@ -20,6 +20,7 @@
 #include <dns/message.h>
 #include <dns/rrset.h>
 #include <nsas/nsas_entry.h>
+#include <cache/dll.h>
 #include "rrset_cache.h"
 #include "rrset_entry.h"
 
@@ -28,13 +29,15 @@ using namespace isc::nsas;
 namespace isc {
 namespace cache {
 
-class RRsetEntry;
+class B10_LIBCACHE_API RRsetEntry;
 
 /// \brief Message Entry
 ///
 /// The object of MessageEntry represents one response message
 /// answered to the resolver client.
-class MessageEntry : isc::util::noncopyable, public NsasEntry<MessageEntry> {
+class B10_LIBCACHE_API MessageEntry :
+    isc::util::noncopyable, public NsasEntry<MessageEntry>
+{
     /// \brief Information to refer an RRset.
     ///
     /// There is no class information here, since the rrsets are cached in
diff --git a/src/lib/cache/message_utility.cc b/src/lib/cache/message_utility.cc
index 53a3352..99ccd06 100644
--- a/src/lib/cache/message_utility.cc
+++ b/src/lib/cache/message_utility.cc
@@ -14,6 +14,8 @@
 
 // $Id$
 
+#define B10_LIBCACHE_EXPORT
+
 #include "message_utility.h"
 #include <dns/rcode.h>
 
diff --git a/src/lib/cache/message_utility.h b/src/lib/cache/message_utility.h
index a77af07..a822203 100644
--- a/src/lib/cache/message_utility.h
+++ b/src/lib/cache/message_utility.h
@@ -18,6 +18,7 @@
 #define __MESSAGE_UTILITY_H
 
 #include <dns/message.h>
+#include <cache/dll.h>
 
 namespace isc {
 namespace cache {
diff --git a/src/lib/cache/resolver_cache.cc b/src/lib/cache/resolver_cache.cc
index 20f470e..b67f36b 100644
--- a/src/lib/cache/resolver_cache.cc
+++ b/src/lib/cache/resolver_cache.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include "resolver_cache.h"
diff --git a/src/lib/cache/resolver_cache.h b/src/lib/cache/resolver_cache.h
index 25aa32e..ead6f5d 100644
--- a/src/lib/cache/resolver_cache.h
+++ b/src/lib/cache/resolver_cache.h
@@ -22,6 +22,7 @@
 #include <dns/message.h>
 #include <exceptions/exceptions.h>
 #include <util/nonassignable.h>
+#include <cache/dll.h>
 #include "message_cache.h"
 #include "rrset_cache.h"
 #include "local_zone_data.h"
@@ -38,7 +39,7 @@ class RRsetCache;
 /// \brief Cache Size Information.
 ///
 /// Used to initialize the size of class-specific rrset/message cache.
-struct CacheSizeInfo
+struct B10_LIBCACHE_API CacheSizeInfo
 {
 public:
     /// \brief Constructor
@@ -63,7 +64,7 @@ public:
 ///
 /// Thrown if the given message has no question section when looking up
 /// the message in cache.
-class MessageNoQuestionSection : public isc::Exception {
+class B10_LIBCACHE_API MessageNoQuestionSection : public isc::Exception {
 public:
     MessageNoQuestionSection(const char*file, size_t line, const char*what) :
         isc::Exception(file, line, what)
@@ -80,7 +81,7 @@ public:
 ///
 /// \todo The resolver cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class ResolverClassCache : isc::util::nonassignable {
+class B10_LIBCACHE_API ResolverClassCache : isc::util::nonassignable {
 public:
     /// \brief Default Constructor.
     ///
@@ -200,7 +201,7 @@ private:
     RRsetCachePtr negative_soa_cache_;
 };
 
-class ResolverCache {
+class B10_LIBCACHE_API ResolverCache {
 public:
     /// \brief Default Constructor.
     ///
diff --git a/src/lib/cache/rrset_cache.cc b/src/lib/cache/rrset_cache.cc
index bb4d339..0349555 100644
--- a/src/lib/cache/rrset_cache.cc
+++ b/src/lib/cache/rrset_cache.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include "rrset_cache.h"
diff --git a/src/lib/cache/rrset_cache.h b/src/lib/cache/rrset_cache.h
index adb4818..2ef18bf 100644
--- a/src/lib/cache/rrset_cache.h
+++ b/src/lib/cache/rrset_cache.h
@@ -15,6 +15,7 @@
 #ifndef __RRSET_CACHE_H
 #define __RRSET_CACHE_H
 
+#include <cache/dll.h>
 #include <cache/rrset_entry.h>
 #include <nsas/hash_table.h>
 
@@ -26,7 +27,7 @@ using namespace isc::nsas;
 namespace isc {
 namespace cache {
 
-class RRsetEntry;
+class B10_LIBCACHE_API RRsetEntry;
 
 /// \brief RRset Cache
 /// The object of RRsetCache represented the cache for class-specific
@@ -34,7 +35,7 @@ class RRsetEntry;
 ///
 /// \todo The rrset cache class should provide the interfaces for
 ///       loading, dumping and resizing.
-class RRsetCache : isc::util::noncopyable {
+class B10_LIBCACHE_API RRsetCache : isc::util::noncopyable {
     ///
     /// \name Constructor and Destructor
     ///
diff --git a/src/lib/cache/rrset_copy.cc b/src/lib/cache/rrset_copy.cc
index b395ce1..ea6104d 100644
--- a/src/lib/cache/rrset_copy.cc
+++ b/src/lib/cache/rrset_copy.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include "rrset_copy.h"
 
 using namespace isc::dns;
@@ -19,7 +21,7 @@ using namespace isc::dns;
 namespace isc {
 namespace cache {
 
-void
+B10_LIBCACHE_API void
 rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst) {
     RdataIteratorPtr rdata_itor = src.getRdataIterator();
     rdata_itor->first();
diff --git a/src/lib/cache/rrset_copy.h b/src/lib/cache/rrset_copy.h
index e1dc489..b7c1c5a 100644
--- a/src/lib/cache/rrset_copy.h
+++ b/src/lib/cache/rrset_copy.h
@@ -15,6 +15,7 @@
 #ifndef __RRSET_COPY_
 #define __RRSET_COPY_
 
+#include <cache/dll.h>
 #include <dns/rrset.h>
 
 namespace isc {
@@ -32,7 +33,7 @@ namespace cache {
 ///       doing RRset copy. But in cache's code, sometime
 ///       we have to do the copy.
 
-void
+B10_LIBCACHE_API void
 rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst);
 
 } // namespace cache
diff --git a/src/lib/cache/rrset_entry.cc b/src/lib/cache/rrset_entry.cc
index 359fd68..9f12b97 100644
--- a/src/lib/cache/rrset_entry.cc
+++ b/src/lib/cache/rrset_entry.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCACHE_EXPORT
+
 #include <config.h>
 
 #include <dns/message.h>
diff --git a/src/lib/cache/rrset_entry.h b/src/lib/cache/rrset_entry.h
index 26d2776..465594a 100644
--- a/src/lib/cache/rrset_entry.h
+++ b/src/lib/cache/rrset_entry.h
@@ -21,6 +21,7 @@
 #include <dns/rrttl.h>
 #include <nsas/nsas_entry.h>
 #include <nsas/fetchable.h>
+#include <cache/dll.h>
 #include "cache_entry_key.h"
 
 using namespace isc::nsas;
@@ -61,7 +62,8 @@ enum RRsetTrustLevel {
 /// The object of RRsetEntry represents one cached RRset.
 /// Each RRset entry may be refered using shared_ptr by several message
 /// entries.
-class RRsetEntry : isc::util::noncopyable, public NsasEntry<RRsetEntry>
+class B10_LIBCACHE_API RRsetEntry :
+    isc::util::noncopyable, public NsasEntry<RRsetEntry>
 {
     ///
     /// \name Constructor and Destructor
@@ -129,4 +131,3 @@ typedef boost::shared_ptr<RRsetEntry> RRsetEntryPtr;
 } // namespace isc
 
 #endif // __RRSET_ENTRY_H
-
diff --git a/src/lib/cc/Makefile.am b/src/lib/cc/Makefile.am
index ec478de..adce01c 100644
--- a/src/lib/cc/Makefile.am
+++ b/src/lib/cc/Makefile.am
@@ -21,7 +21,7 @@ AM_CXXFLAGS += -Wno-error
 endif
 
 lib_LTLIBRARIES = libb10-cc.la
-libb10_cc_la_SOURCES = data.cc data.h session.cc session.h
+libb10_cc_la_SOURCES = dll.h data.cc data.h session.cc session.h
 libb10_cc_la_SOURCES += logger.cc logger.h
 nodist_libb10_cc_la_SOURCES = cc_messages.cc cc_messages.h
 libb10_cc_la_LIBADD = $(top_builddir)/src/lib/log/libb10-log.la
diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
index 6ec243a..f6c82e1 100644
--- a/src/lib/cc/data.cc
+++ b/src/lib/cc/data.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCC_EXPORT
+
 #include <config.h>
 
 #include <cc/data.h>
@@ -182,17 +184,18 @@ throwJSONError(const std::string& error, const std::string& file, int line,
 }
 }
 
-std::ostream&
+B10_LIBCC_API std::ostream&
 operator<<(std::ostream &out, const Element& e) {
     return (out << e.str());
 }
 
-bool
+B10_LIBCC_API bool
 operator==(const Element& a, const Element& b) {
     return (a.equals(b));
 }
 
-bool operator!=(const Element& a, const Element& b) {
+B10_LIBCC_API bool
+operator!=(const Element& a, const Element& b) {
     return (!a.equals(b));
 };
 
@@ -906,12 +909,12 @@ MapElement::equals(const Element& other) const {
     }
 }
 
-bool
+B10_LIBCC_API bool
 isNull(ConstElementPtr p) {
     return (!p);
 }
 
-void
+B10_LIBCC_API void
 removeIdentical(ElementPtr a, ConstElementPtr b) {
     if (!b) {
         return;
@@ -935,7 +938,7 @@ removeIdentical(ElementPtr a, ConstElementPtr b) {
     }
 }
 
-ConstElementPtr
+B10_LIBCC_API ConstElementPtr
 removeIdentical(ConstElementPtr a, ConstElementPtr b) {
     ElementPtr result = Element::createMap();
 
@@ -959,7 +962,7 @@ removeIdentical(ConstElementPtr a, ConstElementPtr b) {
     return (result);
 }
 
-void
+B10_LIBCC_API void
 merge(ElementPtr element, ConstElementPtr other) {
     if (element->getType() != Element::map ||
         other->getType() != Element::map) {
diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h
index 5c731e6..916a3f0 100644
--- a/src/lib/cc/data.h
+++ b/src/lib/cc/data.h
@@ -21,10 +21,11 @@
 #include <boost/shared_ptr.hpp>
 #include <stdexcept>
 #include <exceptions/exceptions.h>
+#include <cc/dll.h>
 
 namespace isc { namespace data {
 
-class Element;
+class B10_LIBCC_API Element;
 // todo: describe the rationale behind ElementPtr?
 typedef boost::shared_ptr<Element> ElementPtr;
 typedef boost::shared_ptr<const Element> ConstElementPtr;
@@ -34,7 +35,7 @@ typedef boost::shared_ptr<const Element> ConstElementPtr;
 /// is called for an Element that has a wrong type (e.g. int_value on a
 /// ListElement)
 ///
-class TypeError : public isc::Exception {
+class B10_LIBCC_API TypeError : public isc::Exception {
 public:
     TypeError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -47,7 +48,7 @@ public:
 // i'd like to use Exception here but we need one that is derived from
 // runtime_error (as this one is directly based on external data, and
 // i want to add some values to any static data string that is provided)
-class JSONError : public isc::Exception {
+class B10_LIBCC_API JSONError : public isc::Exception {
 public:
     JSONError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -70,7 +71,7 @@ public:
 /// raising a \c TypeError for functions that are not supported for
 /// the type in question.
 ///
-class Element {
+class B10_LIBCC_API Element {
     
 private:
     // technically the type could be omitted; is it useful?
@@ -371,7 +372,7 @@ public:
     //@}
 };
 
-class IntElement : public Element {
+class B10_LIBCC_API IntElement : public Element {
     long int i;
 
 public:
@@ -385,7 +386,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class DoubleElement : public Element {
+class B10_LIBCC_API DoubleElement : public Element {
     double d;
 
 public:
@@ -399,7 +400,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class BoolElement : public Element {
+class B10_LIBCC_API BoolElement : public Element {
     bool b;
 
 public:
@@ -413,14 +414,14 @@ public:
     bool equals(const Element& other) const;
 };
 
-class NullElement : public Element {
+class B10_LIBCC_API NullElement : public Element {
 public:
     NullElement() : Element(null) {};
     void toJSON(std::ostream& ss) const;
     bool equals(const Element& other) const;
 };
 
-class StringElement : public Element {
+class B10_LIBCC_API StringElement : public Element {
     std::string s;
 
 public:
@@ -434,7 +435,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class ListElement : public Element {
+class B10_LIBCC_API ListElement : public Element {
     std::vector<ConstElementPtr> l;
 
 public:
@@ -464,7 +465,7 @@ public:
     bool equals(const Element& other) const;
 };
 
-class MapElement : public Element {
+class B10_LIBCC_API MapElement : public Element {
     std::map<std::string, ConstElementPtr> m;
 
 public:
@@ -515,7 +516,7 @@ public:
 /// Checks whether the given ElementPtr is a NULL pointer
 /// \param p The ElementPtr to check
 /// \return true if it is NULL, false if not.
-bool isNull(ConstElementPtr p);
+B10_LIBCC_API bool isNull(ConstElementPtr p);
 
 ///
 /// \brief Remove all values from the first ElementPtr that are
@@ -524,14 +525,15 @@ bool isNull(ConstElementPtr p);
 /// only contains new and changed values (for ModuleCCSession and
 /// configuration update handlers)
 /// Raises a TypeError if a or b are not MapElements
-void removeIdentical(ElementPtr a, ConstElementPtr b);
+B10_LIBCC_API void removeIdentical(ElementPtr a, ConstElementPtr b);
 
 /// \brief Create a new ElementPtr from the first ElementPtr, removing all
 /// values that are equal in the second. Both ElementPtrs MUST be MapElements.
 /// The returned ElementPtr will be a MapElement that only contains new and
 /// changed values (for ModuleCCSession and configuration update handlers).
 /// Raises a TypeError if a or b are not MapElements
-ConstElementPtr removeIdentical(ConstElementPtr a, ConstElementPtr b);
+B10_LIBCC_API ConstElementPtr
+removeIdentical(ConstElementPtr a, ConstElementPtr b);
 
 /// \brief Merges the data from other into element.
 /// (on the first level). Both elements must be
@@ -545,7 +547,7 @@ ConstElementPtr removeIdentical(ConstElementPtr a, ConstElementPtr b);
 /// configuration data (which would then result in reverting back
 /// to the default).
 /// Raises a TypeError if either ElementPtr is not a MapElement
-void merge(ElementPtr element, ConstElementPtr other);
+B10_LIBCC_API void merge(ElementPtr element, ConstElementPtr other);
 
 ///
 /// \brief Insert the Element as a string into stream.
@@ -562,10 +564,11 @@ void merge(ElementPtr element, ConstElementPtr other);
 /// \param e The \c ElementPtr object to insert.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c out after the insertion operation.
-std::ostream& operator<<(std::ostream& out, const Element& e);
+B10_LIBCC_API std::ostream&
+operator<<(std::ostream& out, const Element& e);
 
-bool operator==(const Element& a, const Element& b);
-bool operator!=(const Element& a, const Element& b);
+B10_LIBCC_API bool operator==(const Element& a, const Element& b);
+B10_LIBCC_API bool operator!=(const Element& a, const Element& b);
 } }
 #endif // _ISC_DATA_H
 
diff --git a/src/lib/cc/dll.h b/src/lib/cc/dll.h
new file mode 100644
index 0000000..daf46f6
--- /dev/null
+++ b/src/lib/cc/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCC_H
+#define __LIBCC_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBCC_API
+#else
+#ifdef B10_LIBCC_EXPORT
+#define B10_LIBCC_API __declspec(dllexport)
+#else
+#define B10_LIBCC_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCC_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/cc/logger.cc b/src/lib/cc/logger.cc
index 36db88d..2f38a9c 100644
--- a/src/lib/cc/logger.cc
+++ b/src/lib/cc/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCC_EXPORT
+
 #include <cc/logger.h>
 
 namespace isc {
diff --git a/src/lib/cc/logger.h b/src/lib/cc/logger.h
index d6253d0..8b8754c 100644
--- a/src/lib/cc/logger.h
+++ b/src/lib/cc/logger.h
@@ -15,6 +15,7 @@
 #ifndef CC_LOGGER_H
 #define CC_LOGGER_H
 
+#include <cc/dll.h>
 #include <cc/cc_messages.h>
 #include <log/macros.h>
 
diff --git a/src/lib/cc/session.cc b/src/lib/cc/session.cc
index 4455b68..14ea928 100644
--- a/src/lib/cc/session.cc
+++ b/src/lib/cc/session.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCC_EXPORT
+
 #include <config.h>
 #include <cc/session_config.h>
 #include <cc/logger.h>
diff --git a/src/lib/cc/session.h b/src/lib/cc/session.h
index d045ae2..cae6b80 100644
--- a/src/lib/cc/session.h
+++ b/src/lib/cc/session.h
@@ -23,6 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <cc/dll.h>
 #include <cc/data.h>
 #include <cc/session_config.h>
 
@@ -34,7 +35,7 @@ namespace isc {
     namespace cc {
         class SessionImpl;
 
-        class SessionError : public isc::Exception {
+        class B10_LIBCC_API SessionError : public isc::Exception {
         public:
             SessionError(const char* file, size_t line, const char* what) :
                 isc::Exception(file, line, what) {}
@@ -43,7 +44,7 @@ namespace isc {
         /// \brief A standard Exception class that is thrown when a
         /// blocking readData call does not read the given number of
         /// bytes before the timeout expires
-        class SessionTimeout : public isc::Exception {
+        class B10_LIBCC_API SessionTimeout : public isc::Exception {
         public:
             SessionTimeout(const char* file, size_t line, const char* what) :
                 isc::Exception(file, line, what) {}
@@ -57,7 +58,7 @@ namespace isc {
         /// For simplicity we only define the methods that are necessary for
         /// existing test cases that use this base class.  Eventually we'll
         /// probably have to extend them.
-        class AbstractSession : isc::util::noncopyable {
+        class B10_LIBCC_API AbstractSession : isc::util::noncopyable {
             ///
             /// \name Constructor and Destructor.
             ///
@@ -104,7 +105,7 @@ namespace isc {
             virtual size_t getTimeout() const = 0;
         };
 
-    class Session : public AbstractSession {
+    class B10_LIBCC_API Session : public AbstractSession {
         private:
             SessionImpl* impl_;
 
diff --git a/src/lib/config/Makefile.am b/src/lib/config/Makefile.am
index b4fc2e0..27d8abd 100644
--- a/src/lib/config/Makefile.am
+++ b/src/lib/config/Makefile.am
@@ -12,7 +12,8 @@ config_messages.h config_messages.cc: config_messages.mes
 BUILT_SOURCES = config_messages.h config_messages.cc
 
 lib_LTLIBRARIES = libb10-cfgclient.la
-libb10_cfgclient_la_SOURCES = config_data.h config_data.cc
+libb10_cfgclient_la_SOURCES = dll.h
+libb10_cfgclient_la_SOURCES += config_data.h config_data.cc
 libb10_cfgclient_la_SOURCES += module_spec.h module_spec.cc
 libb10_cfgclient_la_SOURCES += ccsession.cc ccsession.h
 libb10_cfgclient_la_SOURCES += config_log.h config_log.cc
diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc
index d2475cb..be603ba 100644
--- a/src/lib/config/ccsession.cc
+++ b/src/lib/config/ccsession.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCONFIG_EXPORT
+
 #include <config.h>
 
 #include <stdexcept>
@@ -55,7 +57,7 @@ namespace isc {
 namespace config {
 
 /// Creates a standard config/command protocol answer message
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 createAnswer() {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = Element::createList();
@@ -65,7 +67,7 @@ createAnswer() {
     return (answer);
 }
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 createAnswer(const int rcode, ConstElementPtr arg) {
     if (rcode != 0 && (!arg || arg->getType() != Element::string)) {
         isc_throw(CCSessionError, "Bad or no argument for rcode != 0");
@@ -79,7 +81,7 @@ createAnswer(const int rcode, ConstElementPtr arg) {
     return (answer);
 }
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 createAnswer(const int rcode, const std::string& arg) {
     ElementPtr answer = Element::fromJSON("{\"result\": [] }");
     ElementPtr answer_content = Element::createList();
@@ -90,7 +92,7 @@ createAnswer(const int rcode, const std::string& arg) {
     return (answer);
 }
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 parseAnswer(int &rcode, ConstElementPtr msg) {
     if (msg &&
         msg->getType() == Element::map &&
@@ -120,12 +122,12 @@ parseAnswer(int &rcode, ConstElementPtr msg) {
     }
 }
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 createCommand(const std::string& command) {
     return (createCommand(command, ElementPtr()));
 }
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 createCommand(const std::string& command, ConstElementPtr arg) {
     ElementPtr cmd = Element::createMap();
     ElementPtr cmd_parts = Element::createList();
@@ -137,7 +139,7 @@ createCommand(const std::string& command, ConstElementPtr arg) {
     return (cmd);
 }
 
-std::string
+B10_LIBCONFIG_API std::string
 parseCommand(ConstElementPtr& arg, ConstElementPtr command) {
     if (command &&
         command->getType() == Element::map &&
@@ -305,7 +307,7 @@ copyLogger(ConstElementPtr& cur_logger, const std::string& new_name) {
 } // end anonymous namespace
 
 
-ConstElementPtr
+B10_LIBCONFIG_API ConstElementPtr
 getRelatedLoggers(ConstElementPtr loggers) {
     // Keep a list of names for easier lookup later
     std::set<std::string> our_names;
@@ -370,7 +372,7 @@ getRelatedLoggers(ConstElementPtr loggers) {
     return (result);
 }
 
-void
+B10_LIBCONFIG_API void
 default_logconfig_handler(const std::string& module_name,
                           ConstElementPtr new_config,
                           const ConfigData& config_data) {
diff --git a/src/lib/config/ccsession.h b/src/lib/config/ccsession.h
index 045d52a..990589b 100644
--- a/src/lib/config/ccsession.h
+++ b/src/lib/config/ccsession.h
@@ -17,6 +17,7 @@
 
 #include <util/nonassignable.h>
 
+#include <config/dll.h>
 #include <config/config_data.h>
 #include <config/module_spec.h>
 
@@ -34,7 +35,7 @@ namespace config {
 /// \brief Creates a standard config/command level success answer message
 ///        (i.e. of the form { "result": [ 0 ] }
 /// \return Standard command/config success answer message
-isc::data::ConstElementPtr createAnswer();
+B10_LIBCONFIG_API isc::data::ConstElementPtr createAnswer();
 
 ///
 /// \brief Creates a standard config/command level answer message
@@ -46,8 +47,8 @@ isc::data::ConstElementPtr createAnswer();
 ///            Element type. For rcode == 1, this argument is mandatory,
 ///            and must be a StringElement containing an error description
 /// \return Standard command/config answer message
-isc::data::ConstElementPtr createAnswer(const int rcode,
-                                        isc::data::ConstElementPtr arg);
+B10_LIBCONFIG_API isc::data::ConstElementPtr
+createAnswer(const int rcode, isc::data::ConstElementPtr arg);
 
 ///
 /// \brief Creates a standard config/command level answer message
@@ -56,8 +57,8 @@ isc::data::ConstElementPtr createAnswer(const int rcode,
 /// \param rcode The return code (0 for success)
 /// \param arg A string to put into the StringElement argument
 /// \return Standard command/config answer message
-isc::data::ConstElementPtr createAnswer(const int rcode,
-                                        const std::string& arg);
+B10_LIBCONFIG_API isc::data::ConstElementPtr
+createAnswer(const int rcode, const std::string& arg);
 
 ///
 /// Parses a standard config/command level answer message
@@ -68,8 +69,8 @@ isc::data::ConstElementPtr createAnswer(const int rcode,
 /// \return The optional argument in the message, or an empty ElementPtr
 ///         if there was no argument. If rcode != 0, this contains a
 ///         StringElement with the error description.
-isc::data::ConstElementPtr parseAnswer(int &rcode,
-                                       isc::data::ConstElementPtr msg);
+B10_LIBCONFIG_API isc::data::ConstElementPtr
+parseAnswer(int &rcode, isc::data::ConstElementPtr msg);
 
 ///
 /// \brief Creates a standard config/command command message with no
@@ -77,7 +78,8 @@ isc::data::ConstElementPtr parseAnswer(int &rcode,
 /// 
 /// \param command The command string
 /// \return The created message
-isc::data::ConstElementPtr createCommand(const std::string& command);
+B10_LIBCONFIG_API isc::data::ConstElementPtr
+createCommand(const std::string& command);
 
 ///
 /// \brief Creates a standard config/command command message with the
@@ -87,8 +89,8 @@ isc::data::ConstElementPtr createCommand(const std::string& command);
 /// \param arg The optional argument for the command. This can be of 
 ///        any Element type, but it should conform to the .spec file.
 /// \return The created message
-isc::data::ConstElementPtr createCommand(const std::string& command,
-                                         isc::data::ConstElementPtr arg);
+B10_LIBCONFIG_API isc::data::ConstElementPtr
+createCommand(const std::string& command, isc::data::ConstElementPtr arg);
 
 ///
 /// \brief Parses the given command into a string containing the actual
@@ -124,8 +126,9 @@ isc::data::ConstElementPtr createCommand(const std::string& command,
 /// \param command The command message containing the command (as made
 ///        by createCommand()
 /// \return The command name
-std::string parseCommand(isc::data::ConstElementPtr& arg,
-                         isc::data::ConstElementPtr command);
+B10_LIBCONFIG_API std::string
+parseCommand(isc::data::ConstElementPtr& arg,
+             isc::data::ConstElementPtr command);
 
 
 ///
@@ -133,7 +136,7 @@ std::string parseCommand(isc::data::ConstElementPtr& arg,
 /// is there is a problem with one of the messages
 ///
 // todo: include types and called function in the exception
-class CCSessionError : public isc::Exception {
+class B10_LIBCONFIG_API CCSessionError : public isc::Exception {
 public:
     CCSessionError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -142,7 +145,7 @@ public:
 ///
 /// \brief This exception is thrown if the constructor fails
 ///
-class CCSessionInitError : public isc::Exception {
+class B10_LIBCONFIG_API CCSessionInitError : public isc::Exception {
 public:
     CCSessionInitError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -153,7 +156,8 @@ public:
 /// holds configuration information, and handles messages from
 /// the command channel
 ///
-class ModuleCCSession : isc::util::nonassignable, public ConfigData {
+class B10_LIBCONFIG_API ModuleCCSession :
+    isc::util::nonassignable, public ConfigData {
 public:
     /**
      * Initialize a config/command session
@@ -541,7 +545,7 @@ private:
 /// \param new_config The modified configuration values
 /// \param config_data The full config data for the (remote) logging
 ///                    module.
-void
+B10_LIBCONFIG_API void
 default_logconfig_handler(const std::string& module_name,
                           isc::data::ConstElementPtr new_config,
                           const ConfigData& config_data);
@@ -575,7 +579,7 @@ default_logconfig_handler(const std::string& module_name,
 /// \param loggers the original 'loggers' config list
 /// \return ListElement containing only loggers relevant for this
 ///         module, where * is replaced by the root logger name
-isc::data::ConstElementPtr
+B10_LIBCONFIG_API isc::data::ConstElementPtr
 getRelatedLoggers(isc::data::ConstElementPtr loggers);
 
 } // namespace config
diff --git a/src/lib/config/config_data.cc b/src/lib/config/config_data.cc
index ebe51cc..dbe0d23 100644
--- a/src/lib/config/config_data.cc
+++ b/src/lib/config/config_data.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCONFIG_EXPORT
+
 #include <config/config_data.h>
 
 #include <boost/foreach.hpp>
diff --git a/src/lib/config/config_data.h b/src/lib/config/config_data.h
index 3fdbc25..fe40545 100644
--- a/src/lib/config/config_data.h
+++ b/src/lib/config/config_data.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <vector>
 
+#include <config/dll.h>
 #include <config/module_spec.h>
 #include <exceptions/exceptions.h>
 
@@ -27,13 +28,13 @@ namespace config {
 /// This exception is thrown when the caller is trying to access
 /// data that doesn't exist (i.e. with an identifier that does not
 /// point to anything defined in the .spec file)
-class DataNotFoundError : public isc::Exception {
+class B10_LIBCONFIG_API DataNotFoundError : public isc::Exception {
 public:
     DataNotFoundError(const char* file, size_t line, const std::string& what) :
         isc::Exception(file, line, what) {}
 };
 
-class ConfigData {
+class B10_LIBCONFIG_API ConfigData {
 public:
     /// Constructs a ConfigData option with no specification and an
     /// empty configuration.
diff --git a/src/lib/config/config_log.cc b/src/lib/config/config_log.cc
index 672b9f1..aeab5e4 100644
--- a/src/lib/config/config_log.cc
+++ b/src/lib/config/config_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the config lib
 
+#define B10_LIBCONFIG_EXPORT
+
 #include "config/config_log.h"
 
 namespace isc {
diff --git a/src/lib/config/config_log.h b/src/lib/config/config_log.h
index 21709fd..5bfc801 100644
--- a/src/lib/config/config_log.h
+++ b/src/lib/config/config_log.h
@@ -16,6 +16,7 @@
 #define __CONFIG_LOG__H
 
 #include <log/macros.h>
+#include <config/dll.h>
 #include "config_messages.h"
 
 namespace isc {
diff --git a/src/lib/config/dll.h b/src/lib/config/dll.h
new file mode 100644
index 0000000..0be0d9b
--- /dev/null
+++ b/src/lib/config/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCONFIG_H
+#define __LIBCONFIG_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBCONFIG_API
+#else
+#ifdef B10_LIBCONFIG_EXPORT
+#define B10_LIBCONFIG_API __declspec(dllexport)
+#else
+#define B10_LIBCONFIG_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCONFIG_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/config/module_spec.cc b/src/lib/config/module_spec.cc
index da42a5e..59deffb 100644
--- a/src/lib/config/module_spec.cc
+++ b/src/lib/config/module_spec.cc
@@ -13,6 +13,8 @@
 // NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 // WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCONFIG_EXPORT
+
 #include <config/module_spec.h>
 
 #include <sstream>
diff --git a/src/lib/config/module_spec.h b/src/lib/config/module_spec.h
index 27dcfe3..2b0c0b5 100644
--- a/src/lib/config/module_spec.h
+++ b/src/lib/config/module_spec.h
@@ -17,6 +17,7 @@
 #define _MODULE_SPEC_H 1
 
 #include <cc/data.h>
+#include <config/dll.h>
 
 #include <sstream>
 
@@ -26,7 +27,7 @@ namespace isc { namespace config {
     /// A standard ModuleSpec exception that is thrown when a
     /// specification is not in the correct form.
     ///
-    class ModuleSpecError : public isc::Exception {
+    class B10_LIBCONFIG_API ModuleSpecError : public isc::Exception {
     public:
         ModuleSpecError(const char* file, size_t line,
                         const char* what = "Module specification is invalid") :
@@ -43,7 +44,7 @@ namespace isc { namespace config {
     ///
     /// The form of the specification is described in doc/ (TODO)
     ///
-    class ModuleSpec {
+    class B10_LIBCONFIG_API ModuleSpec {
     public:
         ModuleSpec() {};
         /// Create a \c ModuleSpec instance with the given data as
@@ -184,7 +185,7 @@ namespace isc { namespace config {
     /// \param file_name The file to be opened and parsed
     /// \param check If true, the module specification in the file
     /// is checked to be of the correct form
-    ModuleSpec
+    B10_LIBCONFIG_API ModuleSpec
     moduleSpecFromFile(const std::string& file_name, const bool check = true)
         throw(isc::data::JSONError, ModuleSpecError);
 
@@ -196,7 +197,7 @@ namespace isc { namespace config {
     /// \param in The std::istream containing the .spec file data
     /// \param check If true, the module specification is checked
     /// to be of the correct form
-    ModuleSpec
+    B10_LIBCONFIG_API ModuleSpec
     moduleSpecFromFile(std::ifstream& in, const bool check = true)
                        throw(isc::data::JSONError, ModuleSpecError);
 } }
diff --git a/src/lib/cryptolink/Makefile.am b/src/lib/cryptolink/Makefile.am
index 91825d8..a44af9c 100644
--- a/src/lib/cryptolink/Makefile.am
+++ b/src/lib/cryptolink/Makefile.am
@@ -8,7 +8,8 @@ CLEANFILES = *.gcno *.gcda
 
 lib_LTLIBRARIES = libb10-cryptolink.la
 
-libb10_cryptolink_la_SOURCES = cryptolink.h cryptolink.cc
+libb10_cryptolink_la_SOURCES = dll.h
+libb10_cryptolink_la_SOURCES += cryptolink.h cryptolink.cc
 libb10_cryptolink_la_SOURCES += crypto_hmac.h crypto_hmac.cc
 
 libb10_cryptolink_la_LDFLAGS = ${BOTAN_LDFLAGS}
diff --git a/src/lib/cryptolink/crypto_hmac.cc b/src/lib/cryptolink/crypto_hmac.cc
index c1bbfa8..af1c958 100644
--- a/src/lib/cryptolink/crypto_hmac.cc
+++ b/src/lib/cryptolink/crypto_hmac.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCRYPTOLINK_EXPORT
+
 #include <cryptolink.h>
 #include <cryptolink/crypto_hmac.h>
 
@@ -247,7 +249,7 @@ HMAC::verify(const void* sig, const size_t len) {
     return (impl_->verify(sig, len));
 }
 
-void
+B10_LIBCRYPTOLINK_API void
 signHMAC(const void* data, const size_t data_len, const void* secret,
          size_t secret_len, const HashAlgorithm hash_algorithm,
          isc::util::OutputBuffer& result, size_t len)
@@ -261,7 +263,7 @@ signHMAC(const void* data, const size_t data_len, const void* secret,
 }
 
 
-bool
+B10_LIBCRYPTOLINK_API bool
 verifyHMAC(const void* data, const size_t data_len, const void* secret,
            size_t secret_len, const HashAlgorithm hash_algorithm,
            const void* sig, const size_t sig_len)
@@ -274,7 +276,7 @@ verifyHMAC(const void* data, const size_t data_len, const void* secret,
     return (hmac->verify(sig, sig_len));
 }
 
-void
+B10_LIBCRYPTOLINK_API void
 deleteHMAC(HMAC* hmac) {
     delete hmac;
 }
diff --git a/src/lib/cryptolink/crypto_hmac.h b/src/lib/cryptolink/crypto_hmac.h
index 65eb99c..70e24ad 100644
--- a/src/lib/cryptolink/crypto_hmac.h
+++ b/src/lib/cryptolink/crypto_hmac.h
@@ -15,6 +15,7 @@
 #include <util/buffer.h>
 #include <util/noncopyable.h>
 
+#include <cryptolink/dll.h>
 #include <cryptolink/cryptolink.h>
 
 #ifndef _ISC_CRYPTO_HMAC_H
@@ -31,7 +32,7 @@ class HMACImpl;
 /// This class is used to create and verify HMAC signatures. Instances
 /// can be created with CryptoLink::createHMAC()
 ///
-class HMAC : private isc::util::noncopyable {
+class B10_LIBCRYPTOLINK_API HMAC : private isc::util::noncopyable {
 private:
     /// \brief Constructor from a secret and a hash algorithm
     ///
@@ -156,6 +157,7 @@ private:
 /// \param result The signature will be appended to this buffer
 /// \param len If this is non-zero and less than the output size,
 ///            the result will be truncated to len bytes
+B10_LIBCRYPTOLINK_API
 void signHMAC(const void* data,
               const size_t data_len,
               const void* secret,
@@ -190,6 +192,7 @@ void signHMAC(const void* data,
 /// \param sig The signature to verify
 /// \param sig_len The length of the signature
 /// \return True if the signature verifies, false if not
+B10_LIBCRYPTOLINK_API
 bool verifyHMAC(const void* data,
                 const size_t data_len,
                 const void* secret,
@@ -199,7 +202,7 @@ bool verifyHMAC(const void* data,
                 const size_t sig_len);
 
 /// \brief Delete an HMAC object
-void deleteHMAC(HMAC* hmac);
+B10_LIBCRYPTOLINK_API void deleteHMAC(HMAC* hmac);
 
 } // namespace cryptolink
 } // namespace isc
diff --git a/src/lib/cryptolink/cryptolink.cc b/src/lib/cryptolink/cryptolink.cc
index d1c375d..a454cdf 100644
--- a/src/lib/cryptolink/cryptolink.cc
+++ b/src/lib/cryptolink/cryptolink.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBCRYPTOLINK_EXPORT
+
 #include <cryptolink/cryptolink.h>
 #include <cryptolink/crypto_hmac.h>
 
diff --git a/src/lib/cryptolink/cryptolink.h b/src/lib/cryptolink/cryptolink.h
index edb627c..0f6fd27 100644
--- a/src/lib/cryptolink/cryptolink.h
+++ b/src/lib/cryptolink/cryptolink.h
@@ -19,6 +19,7 @@
 #include <util/buffer.h>
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
+#include <cryptolink/dll.h>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -45,11 +46,11 @@ enum HashAlgorithm {
 };
 
 // Forward declaration for createHMAC()
-class HMAC;
+class B10_LIBCRYPTOLINK_API HMAC;
 
 /// General exception class that is the base for all crypto-related
 /// exceptions
-class CryptoLinkError : public Exception {
+class B10_LIBCRYPTOLINK_API CryptoLinkError : public Exception {
 public:
     CryptoLinkError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -57,7 +58,7 @@ public:
 
 /// This exception is thrown if there was a problem initializing the
 /// crypto library
-class InitializationError : public CryptoLinkError {
+class B10_LIBCRYPTOLINK_API InitializationError : public CryptoLinkError {
 public:
     InitializationError(const char* file, size_t line, const char* what) :
         CryptoLinkError(file, line, what) {}
@@ -65,7 +66,7 @@ public:
 
 /// This exception is thrown when a cryptographic action is requested
 /// for an algorithm that is not supported by the underlying library.
-class UnsupportedAlgorithm : public CryptoLinkError {
+class B10_LIBCRYPTOLINK_API UnsupportedAlgorithm : public CryptoLinkError {
 public:
     UnsupportedAlgorithm(const char* file, size_t line, const char* what) :
         CryptoLinkError(file, line, what) {}
@@ -73,7 +74,7 @@ public:
 
 /// This exception is thrown when the underlying library could not
 /// handle the key data.
-class BadKey : public CryptoLinkError {
+class B10_LIBCRYPTOLINK_API BadKey : public CryptoLinkError {
 public:
     BadKey(const char* file, size_t line, const char* what) :
         CryptoLinkError(file, line, what) {}
@@ -83,7 +84,7 @@ public:
 /// specifically caught is thrown by the underlying library. It
 /// is replaced by this one so as not have 'external' exceptions
 /// bubbling up
-class LibraryError : public CryptoLinkError {
+class B10_LIBCRYPTOLINK_API LibraryError : public CryptoLinkError {
 public:
     LibraryError(const char* file, size_t line, const char* what) :
         CryptoLinkError(file, line, what) {}
@@ -130,7 +131,7 @@ class CryptoLinkImpl;
 ///
 // Internal note: we can use this class later to initialize and manage
 // dynamic (PKCS#11) libs
-class CryptoLink : private isc::util::noncopyable {
+class B10_LIBCRYPTOLINK_API CryptoLink : private isc::util::noncopyable {
 public:
     /// \brief Returns a reference to the singleton instance
     ///
diff --git a/src/lib/cryptolink/dll.h b/src/lib/cryptolink/dll.h
new file mode 100644
index 0000000..d3b430e
--- /dev/null
+++ b/src/lib/cryptolink/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBCRYPTOLINK_H
+#define __LIBCRYPTOLINK_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBCRYPTOLINK_API
+#else
+#ifdef B10_LIBCRYPTOLINK_EXPORT
+#define B10_LIBCRYPTOLINK_API __declspec(dllexport)
+#else
+#define B10_LIBCRYPTOLINK_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBCRYPTOLINK_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/datasrc/Makefile.am b/src/lib/datasrc/Makefile.am
index bb18b75..9d5112b 100644
--- a/src/lib/datasrc/Makefile.am
+++ b/src/lib/datasrc/Makefile.am
@@ -21,7 +21,8 @@ CLEANFILES += datasrc_config.h
 CLEANFILES += static.zone
 
 lib_LTLIBRARIES = libb10-datasrc.la
-libb10_datasrc_la_SOURCES = data_source.h data_source.cc
+libb10_datasrc_la_SOURCES = dll.h
+libb10_datasrc_la_SOURCES += data_source.h data_source.cc
 libb10_datasrc_la_SOURCES += static_datasrc.h static_datasrc.cc
 libb10_datasrc_la_SOURCES += sqlite3_datasrc.h sqlite3_datasrc.cc
 libb10_datasrc_la_SOURCES += query.h query.cc
diff --git a/src/lib/datasrc/cache.cc b/src/lib/datasrc/cache.cc
index a4c8d72..6742acc 100644
--- a/src/lib/datasrc/cache.cc
+++ b/src/lib/datasrc/cache.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <stdint.h>
 
 #include <map>
diff --git a/src/lib/datasrc/cache.h b/src/lib/datasrc/cache.h
index 8ffaa6b..b74558a 100644
--- a/src/lib/datasrc/cache.h
+++ b/src/lib/datasrc/cache.h
@@ -20,19 +20,19 @@
 #include <boost/shared_ptr.hpp>
 
 #include <util/noncopyable.h>
-
 #include <dns/rrset.h>
+#include <datasrc/dll.h>
 
 namespace isc {
 namespace dns {
-class Name;
-class RRClass;
-class RRType;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRClass;
+class B10_LIBDATASRC_API RRType;
 }
 
 namespace datasrc {
 
-class CacheNode;
+class B10_LIBDATASRC_API CacheNode;
 typedef boost::shared_ptr<CacheNode> CacheNodePtr;
 typedef boost::shared_ptr<const CacheNode> ConstCacheNodePtr;
 
@@ -82,7 +82,7 @@ class HotCacheImpl;
 /// does not currently use threads, but if it ever does (or if libdatasrc
 /// is ever used by a threaded application), this will need to be
 /// revisited.
-class HotCache : isc::util::noncopyable {
+class B10_LIBDATASRC_API HotCache : isc::util::noncopyable {
 private:
     /// \name Static definitions
     //@{
diff --git a/src/lib/datasrc/client.h b/src/lib/datasrc/client.h
index c427577..fa20fb0 100644
--- a/src/lib/datasrc/client.h
+++ b/src/lib/datasrc/client.h
@@ -24,6 +24,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <datasrc/dll.h>
 #include <datasrc/zone.h>
 
 /// \file
@@ -71,7 +72,7 @@ namespace isc {
 namespace datasrc {
 
 // The iterator.h is not included on purpose, most application won't need it
-class ZoneIterator;
+class B10_LIBDATASRC_API ZoneIterator;
 typedef boost::shared_ptr<ZoneIterator> ZoneIteratorPtr;
 
 /// \brief The base class of data source clients.
@@ -130,7 +131,7 @@ typedef boost::shared_ptr<ZoneIterator> ZoneIteratorPtr;
 ///
 /// \todo This class is still not complete. It will need more factory methods,
 /// e.g. for (re)loading a zone.
-class DataSourceClient : isc::util::noncopyable {
+class B10_LIBDATASRC_API DataSourceClient : isc::util::noncopyable {
 public:
     /// \brief A helper structure to represent the search result of
     /// \c find().
diff --git a/src/lib/datasrc/client_list.cc b/src/lib/datasrc/client_list.cc
index a50a752..fd136fe 100644
--- a/src/lib/datasrc/client_list.cc
+++ b/src/lib/datasrc/client_list.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include "client_list.h"
 #include "client.h"
 #include "factory.h"
diff --git a/src/lib/datasrc/client_list.h b/src/lib/datasrc/client_list.h
index 09e78cd..8d6b1d4 100644
--- a/src/lib/datasrc/client_list.h
+++ b/src/lib/datasrc/client_list.h
@@ -21,6 +21,7 @@
 #include <exceptions/exceptions.h>
 #include <util/noncopyable.h>
 #include <util/nonassignable.h>
+#include <datasrc/dll.h>
 
 #include <vector>
 #include <boost/shared_ptr.hpp>
@@ -28,14 +29,14 @@
 namespace isc {
 namespace datasrc {
 
-class ZoneFinder;
+class B10_LIBDATASRC_API ZoneFinder;
 typedef boost::shared_ptr<ZoneFinder> ZoneFinderPtr;
-class DataSourceClient;
+class B10_LIBDATASRC_API DataSourceClient;
 typedef boost::shared_ptr<DataSourceClient> DataSourceClientPtr;
-class DataSourceClientContainer;
+class B10_LIBDATASRC_API DataSourceClientContainer;
 typedef boost::shared_ptr<DataSourceClientContainer>
     DataSourceClientContainerPtr;
-class InMemoryClient;
+class B10_LIBDATASRC_API InMemoryClient;
 
 /// \brief The list of data source clients.
 ///
@@ -50,7 +51,7 @@ class InMemoryClient;
 /// have it to allow easy testing. It is possible to create a mock-up class
 /// instead of creating a full-blown configuration. The real implementation
 /// is the ConfigurableClientList.
-class ClientList : public isc::util::noncopyable {
+class B10_LIBDATASRC_API ClientList : public isc::util::noncopyable {
 protected:
     /// \brief Constructor.
     ///
@@ -205,7 +206,7 @@ typedef boost::shared_ptr<const ClientList> ConstClientListPtr;
 ///
 /// While it is possible to inherit this class, it is not expected to be
 /// inherited except for tests.
-class ConfigurableClientList : public ClientList {
+class B10_LIBDATASRC_API ConfigurableClientList : public ClientList {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/datasrc/data_source.cc b/src/lib/datasrc/data_source.cc
index 97503c8..c7d25c7 100644
--- a/src/lib/datasrc/data_source.cc
+++ b/src/lib/datasrc/data_source.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <config.h>
 
 #include <cassert>
diff --git a/src/lib/datasrc/data_source.h b/src/lib/datasrc/data_source.h
index f90ed96..89db79a 100644
--- a/src/lib/datasrc/data_source.h
+++ b/src/lib/datasrc/data_source.h
@@ -29,28 +29,29 @@
 #include <dns/name.h>
 #include <dns/rrclass.h>
 #include <cc/data.h>
+#include <datasrc/dll.h>
 
 namespace isc {
 
 namespace dns {
-class Name;
-class RRType;
-class RRset;
-class RRsetList;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRType;
+class B10_LIBDATASRC_API RRset;
+class B10_LIBDATASRC_API RRsetList;
 }
 
 namespace datasrc {
 
-class DataSrcMatch;
-class Query;
+class B10_LIBDATASRC_API DataSrcMatch;
+class B10_LIBDATASRC_API Query;
 
-class DataSrc;
+class B10_LIBDATASRC_API DataSrc;
 typedef boost::shared_ptr<DataSrc> DataSrcPtr;
 typedef boost::shared_ptr<const DataSrc> ConstDataSrcPtr;
 
 /// This exception represents Backend-independent errors relating to
 /// data source operations.
-class DataSourceError : public Exception {
+class B10_LIBDATASRC_API DataSourceError : public Exception {
 public:
     DataSourceError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -62,14 +63,14 @@ public:
 /// combination does not exist in the differences table.  (Note that this
 /// includes the case where the differences table contains no records related
 /// to that zone.)
-class NoSuchSerial : public DataSourceError {
+class B10_LIBDATASRC_API NoSuchSerial : public DataSourceError {
 public:
     NoSuchSerial(const char* file, size_t line, const char* what) :
         DataSourceError(file, line, what) {}
 };
 
 
-class AbstractDataSrc : isc::util::noncopyable {
+class B10_LIBDATASRC_API AbstractDataSrc : isc::util::noncopyable {
     ///
     /// \name Constructor and Destructor.
     ///
@@ -170,7 +171,7 @@ public:
 };
 
 // Base class for a DNS Data Source
-class DataSrc : public AbstractDataSrc {
+class B10_LIBDATASRC_API DataSrc : public AbstractDataSrc {
     ///
     /// \name Constructor and Destructor.
     ///
@@ -231,7 +232,7 @@ private:
     isc::dns::RRClass rrclass;
 };
 
-class MetaDataSrc : public DataSrc {
+class B10_LIBDATASRC_API MetaDataSrc : public DataSrc {
     ///
     /// \name Constructor and Destructor.
     ///
@@ -311,7 +312,7 @@ private:
 ///  - There is no matching %data source and name found (which is probably
 ///    wrong, see below), or the given enclosing name gives a longer match
 ///    than the currently stored enclosing name against the specified name.
-class DataSrcMatch : isc::util::noncopyable {
+class B10_LIBDATASRC_API DataSrcMatch : isc::util::noncopyable {
     ///
     /// \name Constructor and Destructor.
     ///
@@ -392,7 +393,7 @@ private:
     const isc::dns::RRClass& rrclass_;
 };
 
-class Nsec3Param : isc::util::nonassignable {
+class B10_LIBDATASRC_API Nsec3Param : isc::util::nonassignable {
 public:
     Nsec3Param(uint8_t a, uint8_t f, uint16_t i, const std::vector<uint8_t>& s);
     std::string getHash(const isc::dns::Name& name) const;
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 1e38123..3dfd77e 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <string>
 #include <utility>
 #include <vector>
diff --git a/src/lib/datasrc/database.h b/src/lib/datasrc/database.h
index 02298ec..a0f4089 100644
--- a/src/lib/datasrc/database.h
+++ b/src/lib/datasrc/database.h
@@ -24,6 +24,7 @@
 #include <dns/rrset.h>
 #include <dns/rrtype.h>
 
+#include <datasrc/dll.h>
 #include <datasrc/data_source.h>
 #include <datasrc/client.h>
 #include <datasrc/zone.h>
@@ -60,7 +61,7 @@ namespace datasrc {
 ///     database, having multiple instances of this class. If the database
 ///     allows having multiple open queries at one connection, the connection
 ///     class may share it.
-class DatabaseAccessor : isc::util::noncopyable {
+class B10_LIBDATASRC_API DatabaseAccessor : isc::util::noncopyable {
 public:
     /// \brief Data columns for by IteratorContext::getNext()
     ///
@@ -810,7 +811,7 @@ public:
 /// While it is possible to subclass it for specific database in case
 /// of special needs, it is not expected to be needed. This should just
 /// work as it is with whatever DatabaseAccessor.
-class DatabaseClient : public DataSourceClient {
+class B10_LIBDATASRC_API DatabaseClient : public DataSourceClient {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/datasrc/dll.h b/src/lib/datasrc/dll.h
new file mode 100644
index 0000000..1734d5b
--- /dev/null
+++ b/src/lib/datasrc/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBDATASRC_H
+#define __LIBDATASRC_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBDATASRC_API
+#else
+#ifdef B10_LIBDATASRC_EXPORT
+#define B10_LIBDATASRC_API __declspec(dllexport)
+#else
+#define B10_LIBDATASRC_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDATASRC_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/datasrc/factory.cc b/src/lib/datasrc/factory.cc
index 82b4df9..b9479b8 100644
--- a/src/lib/datasrc/factory.cc
+++ b/src/lib/datasrc/factory.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include "factory.h"
 
 #include "data_source.h"
diff --git a/src/lib/datasrc/factory.h b/src/lib/datasrc/factory.h
index 7f22a2c..9fa7be2 100644
--- a/src/lib/datasrc/factory.h
+++ b/src/lib/datasrc/factory.h
@@ -15,6 +15,7 @@
 #ifndef __DATA_SOURCE_FACTORY_H
 #define __DATA_SOURCE_FACTORY_H 1
 
+#include <datasrc/dll.h>
 #include <datasrc/data_source.h>
 #include <datasrc/client.h>
 
@@ -30,7 +31,7 @@ namespace datasrc {
 
 /// \brief Raised if there is an error loading the datasource implementation
 ///        library
-class DataSourceLibraryError : public DataSourceError {
+class B10_LIBDATASRC_API DataSourceLibraryError : public DataSourceError {
 public:
     DataSourceLibraryError(const char* file, size_t line, const char* what) :
         DataSourceError(file, line, what) {}
@@ -38,7 +39,8 @@ public:
 
 /// \brief Raised if there is an error reading a symbol from the datasource
 ///        implementation library
-class DataSourceLibrarySymbolError : public DataSourceError {
+class B10_LIBDATASRC_API DataSourceLibrarySymbolError :
+    public DataSourceError {
 public:
     DataSourceLibrarySymbolError(const char* file, size_t line,
                                  const char* what) :
@@ -61,7 +63,7 @@ typedef void ds_destructor(DataSourceClient* instance);
 ///       in other places than for dynamically loading datasources, then, apart
 ///       from moving it to another location, we also need to make the
 ///       exceptions raised more general.
-class LibraryContainer : isc::util::noncopyable {
+class B10_LIBDATASRC_API LibraryContainer : isc::util::noncopyable {
 public:
     /// \brief Constructor
     ///
@@ -142,7 +144,7 @@ private:
 /// derived classes as well. Currently, the class is actually derived in some
 /// of the tests, which is rather unclean (as this class as written is really
 /// intended to be used directly).
-class DataSourceClientContainer : isc::util::noncopyable {
+class B10_LIBDATASRC_API DataSourceClientContainer : isc::util::noncopyable {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/datasrc/iterator.h b/src/lib/datasrc/iterator.h
index 6e37c1d..d2a2231 100644
--- a/src/lib/datasrc/iterator.h
+++ b/src/lib/datasrc/iterator.h
@@ -18,7 +18,7 @@
 #include <dns/rrset.h>
 
 #include <util/noncopyable.h>
-
+#include <datasrc/dll.h>
 #include <datasrc/zone.h>
 
 namespace isc {
@@ -34,7 +34,7 @@ namespace datasrc {
  *
  * There's no way to start iterating from the beginning again or return.
  */
-class ZoneIterator : public isc::util::noncopyable {
+class B10_LIBDATASRC_API ZoneIterator : public isc::util::noncopyable {
 public:
     /**
      * \brief Destructor
diff --git a/src/lib/datasrc/logger.cc b/src/lib/datasrc/logger.cc
index 846e43b..dd51046 100644
--- a/src/lib/datasrc/logger.cc
+++ b/src/lib/datasrc/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <datasrc/logger.h>
 
 namespace isc {
diff --git a/src/lib/datasrc/logger.h b/src/lib/datasrc/logger.h
index db4e5cb..0ead6bf 100644
--- a/src/lib/datasrc/logger.h
+++ b/src/lib/datasrc/logger.h
@@ -16,6 +16,7 @@
 #define __DATASRC_LOGGER_H
 
 #include <log/macros.h>
+#include <datasrc/dll.h>
 #include <datasrc/datasrc_messages.h>
 
 /// \file datasrc/logger.h
diff --git a/src/lib/datasrc/memory/Makefile.am b/src/lib/datasrc/memory/Makefile.am
index 90ab7b8..10aa26f 100644
--- a/src/lib/datasrc/memory/Makefile.am
+++ b/src/lib/datasrc/memory/Makefile.am
@@ -11,6 +11,7 @@ CLEANFILES = *.gcno *.gcda datasrc_messages.h datasrc_messages.cc
 noinst_LTLIBRARIES = libdatasrc_memory.la
 
 libdatasrc_memory_la_SOURCES = \
+	dll.h \
 	rdata_encoder.h \
 	rdata_encoder.cc \
 	domaintree.h
diff --git a/src/lib/datasrc/memory/dll.h b/src/lib/datasrc/memory/dll.h
new file mode 100644
index 0000000..271b708
--- /dev/null
+++ b/src/lib/datasrc/memory/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBDATASRC_MEMORY_H
+#define __LIBDATASRC_MEMORY_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBDATASRC_MEMORY_API
+#else
+#ifdef B10_LIBDATASRC_MEMORY_EXPORT
+#define B10_LIBDATASRC_MEMORY_API __declspec(dllexport)
+#else
+#define B10_LIBDATASRC_MEMORY_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDATASRC_MEMORY_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h
index 8a304f1..c93eda0 100644
--- a/src/lib/datasrc/memory/domaintree.h
+++ b/src/lib/datasrc/memory/domaintree.h
@@ -29,6 +29,7 @@
 #include <util/noncopyable.h>
 #include <dns/name.h>
 #include <dns/labelsequence.h>
+#include <datasrc/memory/dll.h>
 
 #include <boost/utility.hpp>
 #include <boost/shared_ptr.hpp>
diff --git a/src/lib/datasrc/memory/rdata_encoder.cc b/src/lib/datasrc/memory/rdata_encoder.cc
index 1c27d85..3e378a5 100644
--- a/src/lib/datasrc/memory/rdata_encoder.cc
+++ b/src/lib/datasrc/memory/rdata_encoder.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_MEMORY_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <util/buffer.h>
@@ -526,7 +528,7 @@ RdataEncoder::encode(void* buf, size_t buf_len) const {
 }
 
 namespace testing {
-void
+B10_LIBDATASRC_MEMORY_API void
 foreachRdataField(RRClass rrclass, RRType rrtype,
                   size_t rdata_count,
                   const vector<uint8_t>& encoded_data,
@@ -576,7 +578,7 @@ foreachRdataField(RRClass rrclass, RRType rrtype,
     assert(varlen_count == encode_spec.varlen_count * rdata_count);
 }
 
-void
+B10_LIBDATASRC_MEMORY_API void
 foreachRRSig(const vector<uint8_t>& encoded_data,
              const vector<uint16_t>& rrsiglen_list,
              DataCallback data_callback)
diff --git a/src/lib/datasrc/memory/rdata_encoder.h b/src/lib/datasrc/memory/rdata_encoder.h
index 684b131..4803802 100644
--- a/src/lib/datasrc/memory/rdata_encoder.h
+++ b/src/lib/datasrc/memory/rdata_encoder.h
@@ -24,6 +24,8 @@
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
 
+#include <datasrc/memory/dll.h>
+
 #include <boost/function.hpp>
 
 #include <vector>
@@ -101,7 +103,7 @@ namespace memory {
 /// This is thrown when \c RdataEncoder encounters a rare, unsupported
 /// situation. a method is called for a name or RRset which
 /// is not in or below the zone.
-class RdataEncodingError : public Exception {
+class B10_LIBDATASRC_MEMORY_API RdataEncodingError : public Exception {
 public:
     RdataEncodingError(const char* file, size_t line, const char* what) :
         Exception(file, line, what) {}
@@ -150,7 +152,7 @@ enum RdataNameAttributes {
 ///
 /// The caller can reuse the \c RdataEncoder object for another set of RDATA
 /// by repeating the session from \c start().
-class RdataEncoder : isc::util::noncopyable {
+class B10_LIBDATASRC_MEMORY_API RdataEncoder : isc::util::noncopyable {
 public:
     /// \brief Default constructor.
     RdataEncoder();
@@ -294,6 +296,7 @@ typedef boost::function<void(const uint8_t*, size_t)> DataCallback;
 // the number of RDATAs.  If the encoded data contain variable-length
 // data fields, varlen_list should store a sequence of their lengths,
 // in the order of the appearance.
+B10_LIBDATASRC_MEMORY_API
 void foreachRdataField(dns::RRClass rrclass, dns::RRType rrtype,
                        size_t rdata_count,
                        const std::vector<uint8_t>& encoded_data,
@@ -304,6 +307,7 @@ void foreachRdataField(dns::RRClass rrclass, dns::RRType rrtype,
 // callback for each.  rrsiglen_list should store a sequence of their lengths,
 // in the order of the appearance.  Its size is the number of RRSIGs.
 // The list can be empty, in which case this function does nothing.
+B10_LIBDATASRC_MEMORY_API
 void foreachRRSig(const std::vector<uint8_t>& encoded_data,
                   const std::vector<uint16_t>& rrsiglen_list,
                   DataCallback data_callback);
diff --git a/src/lib/datasrc/memory_datasrc.cc b/src/lib/datasrc/memory_datasrc.cc
index f26cbb3..1f3eaae 100644
--- a/src/lib/datasrc/memory_datasrc.cc
+++ b/src/lib/datasrc/memory_datasrc.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <util/nonassignable.h>
diff --git a/src/lib/datasrc/memory_datasrc.h b/src/lib/datasrc/memory_datasrc.h
index 4e133eb..b707645 100644
--- a/src/lib/datasrc/memory_datasrc.h
+++ b/src/lib/datasrc/memory_datasrc.h
@@ -19,6 +19,7 @@
 
 #include <util/noncopyable.h>
 
+#include <datasrc/dll.h>
 #include <datasrc/zonetable.h>
 #include <datasrc/client.h>
 
@@ -26,8 +27,8 @@
 
 namespace isc {
 namespace dns {
-class Name;
-class RRsetList;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRsetList;
 };
 
 namespace datasrc {
@@ -40,7 +41,9 @@ namespace datasrc {
 /// backend).  This is why the class has methods like \c load() or \c add().
 ///
 /// This class is non copyable.
-class InMemoryZoneFinder : isc::util::noncopyable, public ZoneFinder {
+class B10_LIBDATASRC_API InMemoryZoneFinder :
+    isc::util::noncopyable, public ZoneFinder
+{
     ///
     /// \name Constructors and Destructor.
 public:
@@ -253,7 +256,7 @@ private:
 /// The findZone() method takes a domain name and returns the best matching
 /// \c InMemoryZoneFinder in the form of (Boost) shared pointer, so that it can
 /// provide the general interface for all data sources.
-class InMemoryClient : public DataSourceClient {
+class B10_LIBDATASRC_API InMemoryClient : public DataSourceClient {
 public:
     ///
     /// \name Constructors and Destructor.
@@ -351,11 +354,11 @@ private:
 ///              during initialization
 /// \return An instance of the memory datasource client, or NULL if there was
 ///         an error
-extern "C" DataSourceClient* createInstance(isc::data::ConstElementPtr config,
-                                            std::string& error);
+extern "C" B10_LIBDATASRC_API DataSourceClient*
+createInstance(isc::data::ConstElementPtr config, std::string& error);
 
 /// \brief Destroy the instance created by createInstance()
-extern "C" void destroyInstance(DataSourceClient* instance);
+extern "C" B10_LIBDATASRC_API void destroyInstance(DataSourceClient* instance);
 
 
 }
diff --git a/src/lib/datasrc/memory_datasrc_link.cc b/src/lib/datasrc/memory_datasrc_link.cc
index cbbc6db..2698a17 100644
--- a/src/lib/datasrc/memory_datasrc_link.cc
+++ b/src/lib/datasrc/memory_datasrc_link.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <cc/data.h>
 
 #include <dns/rrclass.h>
@@ -35,7 +37,7 @@ namespace datasrc {
 
 /// This exception is raised if there is an error in the configuration
 /// that has been passed; missing information, duplicate values, etc.
-class InMemoryConfigError : public isc::Exception {
+class B10_LIBDATASRC_API InMemoryConfigError : public isc::Exception {
 public:
     InMemoryConfigError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -245,7 +247,7 @@ applyConfig(isc::datasrc::InMemoryClient& client,
 
 } // end unnamed namespace
 
-DataSourceClient *
+B10_LIBDATASRC_API DataSourceClient *
 createInstance(isc::data::ConstElementPtr config, std::string& error) {
     ElementPtr errors(Element::createList());
     if (!checkConfig(config, errors)) {
@@ -269,7 +271,7 @@ createInstance(isc::data::ConstElementPtr config, std::string& error) {
     }
 }
 
-void destroyInstance(DataSourceClient* instance) {
+B10_LIBDATASRC_API void destroyInstance(DataSourceClient* instance) {
     delete instance;
 }
 
diff --git a/src/lib/datasrc/query.cc b/src/lib/datasrc/query.cc
index a8d675a..6c52e4f 100644
--- a/src/lib/datasrc/query.cc
+++ b/src/lib/datasrc/query.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <util/buffer.h>
 #include <dns/name.h>
 #include <dns/rrset.h>
diff --git a/src/lib/datasrc/query.h b/src/lib/datasrc/query.h
index 9e9a348..fcf5911 100644
--- a/src/lib/datasrc/query.h
+++ b/src/lib/datasrc/query.h
@@ -17,6 +17,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <datasrc/dll.h>
 #include <datasrc/cache.h>
 #include <datasrc/data_source.h>
 
@@ -32,11 +33,11 @@
 namespace isc {
 namespace datasrc {
 
-class Query;
+class B10_LIBDATASRC_API Query;
 typedef boost::shared_ptr<Query> QueryPtr;
 
 // An individual task to be carried out by the query logic
-class QueryTask : isc::util::noncopyable {
+class B10_LIBDATASRC_API QueryTask : isc::util::noncopyable {
 public:
     // XXX: Members are currently public, but should probably be
     // moved to private and wrapped in get() functions later.
@@ -155,7 +156,7 @@ typedef boost::shared_ptr<QueryTask> QueryTaskPtr;
 typedef std::queue<QueryTaskPtr> QueryTaskQueue;
 
 // Data Source query
-class Query : isc::util::noncopyable {
+class B10_LIBDATASRC_API Query : isc::util::noncopyable {
 public:
     // The state of a query: pending or answered.
     enum Status {
diff --git a/src/lib/datasrc/rbnode_rrset.h b/src/lib/datasrc/rbnode_rrset.h
index 28b730f..98e9174 100644
--- a/src/lib/datasrc/rbnode_rrset.h
+++ b/src/lib/datasrc/rbnode_rrset.h
@@ -22,6 +22,7 @@
 #include <dns/rrttl.h>
 #include <dns/rrtype.h>
 #include <util/buffer.h>
+#include <datasrc/dll.h>
 
 #include <string>
 #include <vector>
@@ -43,7 +44,7 @@ struct RBNodeRRsetImpl;
 // Note that the definition of the structure is still hidden within the
 // implementation, so, basically, a normal application should never be able
 // to use it directly even if it peeks into the "internal" namespace.
-struct AdditionalNodeInfo;
+struct B10_LIBDATASRC_API AdditionalNodeInfo;
 
 /// \brief Special RRset for optimizing memory datasource requirement
 ///
@@ -84,7 +85,7 @@ struct AdditionalNodeInfo;
 ///
 // Note: non-Doxygen-documented methods are documented in the base class.
 
-class RBNodeRRset : public isc::dns::AbstractRRset {
+class B10_LIBDATASRC_API RBNodeRRset : public isc::dns::AbstractRRset {
 public:
     /// \brief Usual Constructor
     ///
diff --git a/src/lib/datasrc/rbtree.h b/src/lib/datasrc/rbtree.h
index 3a509e8..13ee640 100644
--- a/src/lib/datasrc/rbtree.h
+++ b/src/lib/datasrc/rbtree.h
@@ -28,6 +28,7 @@
 #include <util/noncopyable.h>
 #include <dns/name.h>
 #include <dns/labelsequence.h>
+#include <datasrc/dll.h>
 
 #include <boost/utility.hpp>
 #include <boost/shared_ptr.hpp>
diff --git a/src/lib/datasrc/result.h b/src/lib/datasrc/result.h
index f7ca363..5320b2c 100644
--- a/src/lib/datasrc/result.h
+++ b/src/lib/datasrc/result.h
@@ -15,6 +15,8 @@
 #ifndef __DATASRC_RESULT_H
 #define __DATASRC_RESULT_H 1
 
+#include <datasrc/dll.h>
+
 namespace isc {
 namespace datasrc {
 namespace result {
diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc
index c046419..aa67172 100644
--- a/src/lib/datasrc/sqlite3_accessor.cc
+++ b/src/lib/datasrc/sqlite3_accessor.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <sqlite3.h>
 
 #include <string>
diff --git a/src/lib/datasrc/sqlite3_accessor.h b/src/lib/datasrc/sqlite3_accessor.h
index 3e44d5b..ca2d6df 100644
--- a/src/lib/datasrc/sqlite3_accessor.h
+++ b/src/lib/datasrc/sqlite3_accessor.h
@@ -16,6 +16,7 @@
 #ifndef __DATASRC_SQLITE3_ACCESSOR_H
 #define __DATASRC_SQLITE3_ACCESSOR_H
 
+#include <datasrc/dll.h>
 #include <datasrc/database.h>
 #include <datasrc/data_source.h>
 
@@ -29,7 +30,7 @@
 
 namespace isc {
 namespace dns {
-class RRClass;
+class B10_LIBDATASRC_API RRClass;
 }
 
 namespace datasrc {
@@ -41,13 +42,13 @@ namespace datasrc {
  * It might mean corrupt database file, invalid request or that something is
  * rotten in the library.
  */
-class SQLite3Error : public DataSourceError {
+class B10_LIBDATASRC_API SQLite3Error : public DataSourceError {
 public:
     SQLite3Error(const char* file, size_t line, const char* what) :
         DataSourceError(file, line, what) {}
 };
 
-class IncompatibleDbVersion : public Exception {
+class B10_LIBDATASRC_API IncompatibleDbVersion : public Exception {
 public:
     IncompatibleDbVersion(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -59,7 +60,7 @@ public:
  * Thrown if a query expecting a certain number of rows back returned too
  * many rows.
  */
-class TooMuchData : public DataSourceError {
+class B10_LIBDATASRC_API TooMuchData : public DataSourceError {
 public:
     TooMuchData(const char* file, size_t line, const char* what) :
         DataSourceError(file, line, what) {}
@@ -71,7 +72,7 @@ public:
  * Thrown if a query expecting a certain number of rows back returned too
  * few rows (including none).
  */
-class TooLittleData : public DataSourceError {
+class B10_LIBDATASRC_API TooLittleData : public DataSourceError {
 public:
     TooLittleData(const char* file, size_t line, const char* what) :
         DataSourceError(file, line, what) {}
@@ -86,7 +87,7 @@ struct SQLite3Parameters;
  * According to the design, it doesn't interpret the data in any way, it just
  * provides unified access to the DB.
  */
-class SQLite3Accessor : public DatabaseAccessor,
+class B10_LIBDATASRC_API SQLite3Accessor : public DatabaseAccessor,
     public boost::enable_shared_from_this<SQLite3Accessor> {
 public:
     /**
@@ -282,11 +283,11 @@ private:
 ///              during initialization
 /// \return An instance of the sqlite3 datasource client, or NULL if there was
 ///         an error
-extern "C" DataSourceClient* createInstance(isc::data::ConstElementPtr config,
-                                            std::string& error);
+extern "C" B10_LIBDATASRC_API DataSourceClient*
+createInstance(isc::data::ConstElementPtr config, std::string& error);
 
 /// \brief Destroy the instance created by createInstance()
-extern "C" void destroyInstance(DataSourceClient* instance);
+extern "C" B10_LIBDATASRC_API void destroyInstance(DataSourceClient* instance);
 
 }
 }
diff --git a/src/lib/datasrc/sqlite3_accessor_link.cc b/src/lib/datasrc/sqlite3_accessor_link.cc
index c064e0f..c1682f6 100644
--- a/src/lib/datasrc/sqlite3_accessor_link.cc
+++ b/src/lib/datasrc/sqlite3_accessor_link.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <cc/data.h>
 
 #include <dns/rrclass.h>
@@ -75,7 +77,7 @@ checkConfig(ConstElementPtr config, ElementPtr errors) {
 
 } // end unnamed namespace
 
-DataSourceClient *
+B10_LIBDATASRC_API DataSourceClient *
 createInstance(isc::data::ConstElementPtr config, std::string& error) {
     ElementPtr errors(Element::createList());
     if (!checkConfig(config, errors)) {
@@ -99,7 +101,7 @@ createInstance(isc::data::ConstElementPtr config, std::string& error) {
     }
 }
 
-void destroyInstance(DataSourceClient* instance) {
+B10_LIBDATASRC_API void destroyInstance(DataSourceClient* instance) {
     delete instance;
 }
 
diff --git a/src/lib/datasrc/sqlite3_datasrc.cc b/src/lib/datasrc/sqlite3_datasrc.cc
index b450cd5..2debddc 100644
--- a/src/lib/datasrc/sqlite3_datasrc.cc
+++ b/src/lib/datasrc/sqlite3_datasrc.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <string>
 #include <sstream>
 #include <utility>
@@ -49,7 +51,7 @@ using namespace isc::dns::rdata;
 namespace isc {
 namespace datasrc {
 
-struct Sqlite3Parameters {
+struct B10_LIBDATASRC_API Sqlite3Parameters {
     Sqlite3Parameters() :  db_(NULL), major_version_(-1), minor_version_(-1),
         q_zone_(NULL), q_record_(NULL), q_addrs_(NULL), q_referral_(NULL),
         q_any_(NULL), q_count_(NULL), q_previous_(NULL), q_nsec3_(NULL),
diff --git a/src/lib/datasrc/sqlite3_datasrc.h b/src/lib/datasrc/sqlite3_datasrc.h
index debf8af..c822e4c 100644
--- a/src/lib/datasrc/sqlite3_datasrc.h
+++ b/src/lib/datasrc/sqlite3_datasrc.h
@@ -19,35 +19,36 @@
 
 #include <exceptions/exceptions.h>
 
+#include <datasrc/dll.h>
 #include <datasrc/data_source.h>
 
 namespace isc {
 
 namespace dns {
-class Name;
-class RRClass;
-class RRType;
-class RRsetList;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRClass;
+class B10_LIBDATASRC_API RRType;
+class B10_LIBDATASRC_API RRsetList;
 }
 
 namespace datasrc {
 
-class Query;
-struct Sqlite3Parameters;
+class B10_LIBDATASRC_API Query;
+struct B10_LIBDATASRC_API Sqlite3Parameters;
 
-class Sqlite3Error : public Exception {
+class B10_LIBDATASRC_API Sqlite3Error : public Exception {
 public:
     Sqlite3Error(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
-class IncompatibleDbVersion : public Exception {
+class B10_LIBDATASRC_API IncompatibleDbVersion : public Exception {
 public:
     IncompatibleDbVersion(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
-class Sqlite3DataSrc : public DataSrc {
+class B10_LIBDATASRC_API Sqlite3DataSrc : public DataSrc {
     ///
     /// \name Constructors, Assignment Operator and Destructor.
     ///
diff --git a/src/lib/datasrc/static_datasrc.cc b/src/lib/datasrc/static_datasrc.cc
index 2f7ef4e..c6216b3 100644
--- a/src/lib/datasrc/static_datasrc.cc
+++ b/src/lib/datasrc/static_datasrc.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <config.h>
 
 #include <cassert>
diff --git a/src/lib/datasrc/static_datasrc.h b/src/lib/datasrc/static_datasrc.h
index 84c4883..528ab7e 100644
--- a/src/lib/datasrc/static_datasrc.h
+++ b/src/lib/datasrc/static_datasrc.h
@@ -23,23 +23,24 @@
 #ifndef __STATIC_DATA_SOURCE_H
 #define __STATIC_DATA_SOURCE_H
 
+#include <datasrc/dll.h>
 #include <datasrc/data_source.h>
 
 namespace isc {
 
 namespace dns {
-class Name;
-class RRClass;
-class RRType;
-class RRType;
-class RRsetList;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRClass;
+class B10_LIBDATASRC_API RRType;
+class B10_LIBDATASRC_API RRType;
+class B10_LIBDATASRC_API RRsetList;
 }
 
 namespace datasrc {
 
 struct StaticDataSrcImpl;
 
-class StaticDataSrc : public DataSrc {
+class B10_LIBDATASRC_API StaticDataSrc : public DataSrc {
     ///
     /// \name Constructor and Destructor.
     ///
diff --git a/src/lib/datasrc/static_datasrc_link.cc b/src/lib/datasrc/static_datasrc_link.cc
index 789580d..35d5064 100644
--- a/src/lib/datasrc/static_datasrc_link.cc
+++ b/src/lib/datasrc/static_datasrc_link.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include "client.h"
 #include "memory_datasrc.h"
 
@@ -29,7 +31,7 @@ using namespace std;
 namespace isc {
 namespace datasrc {
 
-DataSourceClient*
+B10_LIBDATASRC_API DataSourceClient*
 createInstance(ConstElementPtr config, string& error) {
     try {
         // Create the data source
@@ -53,7 +55,7 @@ createInstance(ConstElementPtr config, string& error) {
     return (NULL);
 }
 
-void
+B10_LIBDATASRC_API void
 destroyInstance(DataSourceClient* instance) {
     delete instance;
 }
diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h
index a4ef92e..b3100c0 100644
--- a/src/lib/datasrc/zone.h
+++ b/src/lib/datasrc/zone.h
@@ -20,7 +20,7 @@
 #include <dns/rrtype.h>
 
 #include <util/nonassignable.h>
-
+#include <datasrc/dll.h>
 #include <datasrc/result.h>
 
 #include <utility>
@@ -33,7 +33,7 @@ namespace datasrc {
 ///
 /// This is thrown when a method is called for a name or RRset which
 /// is not in or below the zone.
-class OutOfZone : public Exception {
+class B10_LIBDATASRC_API OutOfZone : public Exception {
 public:
     OutOfZone(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -64,7 +64,7 @@ public:
 /// same name and type can be different if other threads or programs make
 /// updates to the zone between the lookups.  We should revisit this point
 /// as we gain more experiences.
-class ZoneFinder {
+class B10_LIBDATASRC_API ZoneFinder {
 public:
     /// Result codes of the \c find() method.
     ///
@@ -169,7 +169,7 @@ public:
     /// ZoneFinder that originally performed the \c find() call, and expects
     /// the finder is valid throughout the lifetime of this object.  It's
     /// caller's responsibility to ensure that assumption.
-    class Context : isc::util::nonassignable {
+    class B10_LIBDATASRC_API Context : isc::util::nonassignable {
     public:
         /// \brief The constructor for the normal find call.
         ///
@@ -697,7 +697,7 @@ typedef boost::shared_ptr<ZoneFinder::Context> ConstZoneFinderContextPtr;
 /// \note This initial implementation provides a quite simple interface of
 /// adding and deleting RRs (see the description of the related methods).
 /// It may be revisited as we gain more experiences.
-class ZoneUpdater {
+class B10_LIBDATASRC_API ZoneUpdater {
 protected:
     /// The default constructor.
     ///
@@ -915,7 +915,7 @@ typedef boost::shared_ptr<ZoneUpdater> ZoneUpdaterPtr;
 /// over the sequences.  Every time the \c getNextDiff() method is called
 /// it returns one element of the differences in the form of an \c RRset
 /// until it reaches the end of the entire sequences.
-class ZoneJournalReader {
+class B10_LIBDATASRC_API ZoneJournalReader {
 public:
     /// Result codes used by a factory method for \c ZoneJournalReader
     enum Result {
diff --git a/src/lib/datasrc/zone_finder_context.cc b/src/lib/datasrc/zone_finder_context.cc
index 7913d71..772d53d 100644
--- a/src/lib/datasrc/zone_finder_context.cc
+++ b/src/lib/datasrc/zone_finder_context.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <dns/rdata.h>
 #include <dns/rrset.h>
 #include <dns/rrtype.h>
diff --git a/src/lib/datasrc/zonetable.cc b/src/lib/datasrc/zonetable.cc
index 1193181..5ccffaf 100644
--- a/src/lib/datasrc/zonetable.cc
+++ b/src/lib/datasrc/zonetable.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDATASRC_EXPORT
+
 #include <util/memory_segment.h>
 
 #include <dns/name.h>
diff --git a/src/lib/datasrc/zonetable.h b/src/lib/datasrc/zonetable.h
index 45bd0dc..df1daab 100644
--- a/src/lib/datasrc/zonetable.h
+++ b/src/lib/datasrc/zonetable.h
@@ -21,14 +21,15 @@
 
 #include <dns/rrset.h>
 
+#include <datasrc/dll.h>
 #include <datasrc/zone.h>
 
 #include <boost/shared_ptr.hpp>
 
 namespace isc {
 namespace dns {
-class Name;
-class RRClass;
+class B10_LIBDATASRC_API Name;
+class B10_LIBDATASRC_API RRClass;
 }
 
 namespace datasrc {
@@ -42,7 +43,7 @@ namespace datasrc {
 ///
 /// For more descriptions about its struct and interfaces, please refer to the
 /// corresponding struct and interfaces of \c MemoryDataSrc.
-class ZoneTable : isc::util::noncopyable {
+class B10_LIBDATASRC_API ZoneTable : isc::util::noncopyable {
 public:
     struct FindResult : isc::util::nonassignable {
         FindResult(result::Result param_code, const ZoneFinderPtr param_zone) :
diff --git a/src/lib/dhcp/Makefile.am b/src/lib/dhcp/Makefile.am
index fbd4eb5..63335cf 100644
--- a/src/lib/dhcp/Makefile.am
+++ b/src/lib/dhcp/Makefile.am
@@ -14,7 +14,7 @@ AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
 CLEANFILES = *.gcno *.gcda
 
 lib_LTLIBRARIES = libb10-dhcp++.la
-libb10_dhcp___la_SOURCES  =
+libb10_dhcp___la_SOURCES  = dll.h
 libb10_dhcp___la_SOURCES += libdhcp++.cc libdhcp++.h
 libb10_dhcp___la_SOURCES += iface_mgr.cc iface_mgr.h
 libb10_dhcp___la_SOURCES += iface_mgr_linux.cc
diff --git a/src/lib/dhcp/dll.h b/src/lib/dhcp/dll.h
new file mode 100644
index 0000000..3ae566d
--- /dev/null
+++ b/src/lib/dhcp/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBDHCP_H
+#define __LIBDHCP_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBDHCP_API
+#else
+#ifdef B10_LIBDHCP_EXPORT
+#define B10_LIBDHCP_API __declspec(dllexport)
+#else
+#define B10_LIBDHCP_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDHCP_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 4a24260..324cbcd 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <config.h>
 #include <sstream>
 #include <fstream>
diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h
index 88227ab..16ee214 100644
--- a/src/lib/dhcp/iface_mgr.h
+++ b/src/lib/dhcp/iface_mgr.h
@@ -20,6 +20,7 @@
 #include <boost/scoped_array.hpp>
 #include <asiolink/io_address.h>
 #include <util/noncopyable.h>
+#include <dhcp/dll.h>
 #include <dhcp/dhcp6.h>
 #include <dhcp/dhcp4.h>
 #include <dhcp/pkt4.h>
@@ -34,7 +35,7 @@ namespace dhcp {
 /// interfaces, configured addresses, link-local addresses, and provides
 /// API for using sockets.
 ///
-class IfaceMgr : public isc::util::noncopyable {
+class B10_LIBDHCP_API IfaceMgr : public isc::util::noncopyable {
 public:
     /// type that defines list of addresses
     typedef std::vector<isc::asiolink::IOAddress> AddressCollection;
@@ -79,7 +80,7 @@ public:
     /// Iface structure represents network interface with all useful
     /// information, like name, interface index, MAC address and
     /// list of assigned addresses
-    class Iface {
+    class B10_LIBDHCP_API Iface {
     public:
         /// @brief Iface constructor.
         ///
diff --git a/src/lib/dhcp/iface_mgr_bsd.cc b/src/lib/dhcp/iface_mgr_bsd.cc
index e3f11a1..dbda676 100644
--- a/src/lib/dhcp/iface_mgr_bsd.cc
+++ b/src/lib/dhcp/iface_mgr_bsd.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_BSD)
diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc
index 90431de..50449f0 100644
--- a/src/lib/dhcp/iface_mgr_linux.cc
+++ b/src/lib/dhcp/iface_mgr_linux.cc
@@ -27,6 +27,8 @@
 /// to do something with address labels. Getting a list of interfaces with
 /// addresses configured on it is just a small subset of all possible actions.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_LINUX)
diff --git a/src/lib/dhcp/iface_mgr_sun.cc b/src/lib/dhcp/iface_mgr_sun.cc
index 5847906..7865a89 100644
--- a/src/lib/dhcp/iface_mgr_sun.cc
+++ b/src/lib/dhcp/iface_mgr_sun.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <config.h>
 
 #if defined(OS_SUN)
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index c054a4b..16c1273 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <boost/shared_array.hpp>
 #include <boost/shared_ptr.hpp>
 #include <util/buffer.h>
diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h
index c7935c8..7b3449b 100644
--- a/src/lib/dhcp/libdhcp++.h
+++ b/src/lib/dhcp/libdhcp++.h
@@ -17,12 +17,13 @@
 
 #include <iostream>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 #include <dhcp/pkt6.h>
 
 namespace isc {
 namespace dhcp {
 
-class LibDHCP {
+class B10_LIBDHCP_API LibDHCP {
 
 public:
     /// Builds collection of options.
diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc
index 0c71606..8649613 100644
--- a/src/lib/dhcp/option.cc
+++ b/src/lib/dhcp/option.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <string.h>
 #include <stdint.h>
 #include <arpa/inet.h>
diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h
index 0662967..177bf82 100644
--- a/src/lib/dhcp/option.h
+++ b/src/lib/dhcp/option.h
@@ -20,6 +20,7 @@
 #include <vector>
 #include <boost/shared_ptr.hpp>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 
 namespace isc {
 namespace dhcp {
@@ -39,11 +40,11 @@ typedef OptionBuffer::const_iterator OptionBufferConstIter;
 typedef boost::shared_ptr<OptionBuffer> OptionBufferPtr;
 
 /// shared pointer to Option object
-class Option;
+class B10_LIBDHCP_API Option;
 typedef boost::shared_ptr<Option> OptionPtr;
 
 
-class Option {
+class B10_LIBDHCP_API Option {
 public:
     /// length of the usual DHCPv4 option header (there are exceptions)
     const static size_t OPTION4_HDR_LEN = 2;
diff --git a/src/lib/dhcp/option4_addrlst.cc b/src/lib/dhcp/option4_addrlst.cc
index 4b0224f..006fab6 100644
--- a/src/lib/dhcp/option4_addrlst.cc
+++ b/src/lib/dhcp/option4_addrlst.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <string.h>
 #include <stdint.h>
 #include <arpa/inet.h>
diff --git a/src/lib/dhcp/option4_addrlst.h b/src/lib/dhcp/option4_addrlst.h
index 3bedc6d..c02a180 100644
--- a/src/lib/dhcp/option4_addrlst.h
+++ b/src/lib/dhcp/option4_addrlst.h
@@ -21,6 +21,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_array.hpp>
 #include <util/buffer.h>
+#include <dhcp/dll.h>
 #include <dhcp/option.h>
 
 namespace isc {
@@ -31,7 +32,7 @@ namespace dhcp {
 ///
 /// This class handles a list of IPv4 addresses. An example of such option
 /// is dns-servers option. It can also be used to handle a single address.
-class Option4AddrLst : public isc::dhcp::Option {
+class B10_LIBDHCP_API Option4AddrLst : public isc::dhcp::Option {
 public:
 
     /// Defines a collection of IPv4 addresses.
diff --git a/src/lib/dhcp/option6_addrlst.cc b/src/lib/dhcp/option6_addrlst.cc
index d23b700..716f609 100644
--- a/src/lib/dhcp/option6_addrlst.cc
+++ b/src/lib/dhcp/option6_addrlst.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <stdint.h>
 #include <arpa/inet.h>
 #include <sstream>
diff --git a/src/lib/dhcp/option6_addrlst.h b/src/lib/dhcp/option6_addrlst.h
index 209d2dd..133e9e9 100644
--- a/src/lib/dhcp/option6_addrlst.h
+++ b/src/lib/dhcp/option6_addrlst.h
@@ -17,6 +17,7 @@
 
 #include <vector>
 #include <asiolink/io_address.h>
+#include <dhcp/dll.h>
 #include <dhcp/option.h>
 
 namespace isc {
@@ -26,7 +27,7 @@ namespace dhcp {
 ///
 /// This class handles a list of IPv6 addresses. An example of such option
 /// is dns-servers option. It can also be used to handle single address.
-class Option6AddrLst: public Option {
+class B10_LIBDHCP_API Option6AddrLst : public Option {
 
 public:
     /// a container for (IPv6) addresses
diff --git a/src/lib/dhcp/option6_ia.cc b/src/lib/dhcp/option6_ia.cc
index 65be711..cc164f7 100644
--- a/src/lib/dhcp/option6_ia.cc
+++ b/src/lib/dhcp/option6_ia.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <stdint.h>
 #include <arpa/inet.h>
 #include <sstream>
diff --git a/src/lib/dhcp/option6_ia.h b/src/lib/dhcp/option6_ia.h
index c2089d4..0607700 100644
--- a/src/lib/dhcp/option6_ia.h
+++ b/src/lib/dhcp/option6_ia.h
@@ -17,11 +17,12 @@
 
 #include <stdint.h>
 #include "option.h"
+#include <dhcp/dll.h>
 
 namespace isc {
 namespace dhcp {
 
-class Option6IA: public Option {
+class B10_LIBDHCP_API Option6IA : public Option {
 
 public:
     /// Length of IA_NA and IA_PD content
diff --git a/src/lib/dhcp/option6_iaaddr.cc b/src/lib/dhcp/option6_iaaddr.cc
index 084a5f3..0bf917c 100644
--- a/src/lib/dhcp/option6_iaaddr.cc
+++ b/src/lib/dhcp/option6_iaaddr.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <stdint.h>
 #include <arpa/inet.h>
 #include <sstream>
diff --git a/src/lib/dhcp/option6_iaaddr.h b/src/lib/dhcp/option6_iaaddr.h
index e6e2c16..96e5945 100644
--- a/src/lib/dhcp/option6_iaaddr.h
+++ b/src/lib/dhcp/option6_iaaddr.h
@@ -16,12 +16,13 @@
 #define OPTION6_IAADDR_H_
 
 #include "asiolink/io_address.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 namespace dhcp {
 
-class Option6IAAddr: public Option {
+class B10_LIBDHCP_API Option6IAAddr : public Option {
 
 public:
     /// length of the fixed part of the IAADDR option
diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc
index 2c3f1eb..296f6b1 100644
--- a/src/lib/dhcp/pkt4.cc
+++ b/src/lib/dhcp/pkt4.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
+
 #include <dhcp/pkt4.h>
 #include <dhcp/libdhcp++.h>
 #include <dhcp/dhcp4.h>
diff --git a/src/lib/dhcp/pkt4.h b/src/lib/dhcp/pkt4.h
index b72c03e..08e985c 100644
--- a/src/lib/dhcp/pkt4.h
+++ b/src/lib/dhcp/pkt4.h
@@ -22,13 +22,14 @@
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include "asiolink/io_address.h"
 #include "util/buffer.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 
 namespace dhcp {
 
-class Pkt4 {
+class B10_LIBDHCP_API Pkt4 {
 public:
 
     /// length of the CHADDR field in DHCPv4 message
diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc
index e869c7b..a06907d 100644
--- a/src/lib/dhcp/pkt6.cc
+++ b/src/lib/dhcp/pkt6.cc
@@ -12,6 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDHCP_EXPORT
 
 #include <dhcp/dhcp6.h>
 #include <dhcp/pkt6.h>
diff --git a/src/lib/dhcp/pkt6.h b/src/lib/dhcp/pkt6.h
index b3a3567..b6908ef 100644
--- a/src/lib/dhcp/pkt6.h
+++ b/src/lib/dhcp/pkt6.h
@@ -21,13 +21,14 @@
 #include <boost/shared_array.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include "asiolink/io_address.h"
+#include <dhcp/dll.h>
 #include "dhcp/option.h"
 
 namespace isc {
 
 namespace dhcp {
 
-class Pkt6 {
+class B10_LIBDHCP_API Pkt6 {
 public:
     /// specifes DHCPv6 packet header length
     const static size_t DHCPV6_PKT_HDR_LEN = 4;
diff --git a/src/lib/dns/Makefile.am b/src/lib/dns/Makefile.am
index 38809e0..c271945 100644
--- a/src/lib/dns/Makefile.am
+++ b/src/lib/dns/Makefile.am
@@ -90,7 +90,7 @@ lib_LTLIBRARIES = libb10-dns++.la
 
 libb10_dns___la_LDFLAGS = -no-undefined -version-info 2:0:0
 
-libb10_dns___la_SOURCES =
+libb10_dns___la_SOURCES  = dll.h
 libb10_dns___la_SOURCES += edns.h edns.cc
 libb10_dns___la_SOURCES += exceptions.h exceptions.cc
 libb10_dns___la_SOURCES += labelsequence.h labelsequence.cc
diff --git a/src/lib/dns/character_string.cc b/src/lib/dns/character_string.cc
index 3a289ac..61425b7 100644
--- a/src/lib/dns/character_string.cc
+++ b/src/lib/dns/character_string.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include "character_string.h"
 #include "rdata.h"
 
diff --git a/src/lib/dns/character_string.h b/src/lib/dns/character_string.h
index 7961274..262f84c 100644
--- a/src/lib/dns/character_string.h
+++ b/src/lib/dns/character_string.h
@@ -18,6 +18,7 @@
 #include <string>
 #include <exceptions/exceptions.h>
 #include <util/buffer.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
@@ -40,15 +41,17 @@ namespace characterstr {
     ///        the iterator will be updated to new position after the function
     ///        is returned
     /// \return A std::string that contains the extracted <character-string>
-    std::string getNextCharacterString(const std::string& input_str,
-                                       std::string::const_iterator& input_iterator);
+    B10_LIBDNS_API std::string
+    getNextCharacterString(const std::string& input_str,
+                           std::string::const_iterator& input_iterator);
 
     /// Get a <character-string> from a input buffer
     ///
     /// \param buffer The input buffer
     /// \param len The input buffer total length
     /// \return A std::string that contains the extracted <character-string>
-    std::string getNextCharacterString(util::InputBuffer& buffer, size_t len);
+    B10_LIBDNS_API std::string
+    getNextCharacterString(util::InputBuffer& buffer, size_t len);
 
 } // namespace characterstr
 } // namespace dns
diff --git a/src/lib/dns/dll.h b/src/lib/dns/dll.h
new file mode 100644
index 0000000..e1692df
--- /dev/null
+++ b/src/lib/dns/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBDNS_H
+#define __LIBDNS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBDNS_API
+#else
+#ifdef B10_LIBDNS_EXPORT
+#define B10_LIBDNS_API __declspec(dllexport)
+#else
+#define B10_LIBDNS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/edns.cc b/src/lib/dns/edns.cc
index e2a20ed..fe7ec25 100644
--- a/src/lib/dns/edns.cc
+++ b/src/lib/dns/edns.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <config.h>
 
 #include <stdint.h>
@@ -176,7 +178,7 @@ createEDNSFromRR(const Name& name, const RRClass& rrclass,
     return (edns);
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(std::ostream& os, const EDNS& edns) {
     os << edns.toText();
     return (os);
diff --git a/src/lib/dns/edns.h b/src/lib/dns/edns.h
index 2c30303..6d01032 100644
--- a/src/lib/dns/edns.h
+++ b/src/lib/dns/edns.h
@@ -21,24 +21,26 @@
 
 #include <ostream>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 namespace isc {
 namespace util {
-class OutputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
 
-class EDNS;
-class Name;
-class AbstractMessageRenderer;
-class RRClass;
-class RRTTL;
-class RRType;
-class Rcode;
+class B10_LIBDNS_API EDNS;
+class B10_LIBDNS_API Name;
+class B10_LIBDNS_API AbstractMessageRenderer;
+class B10_LIBDNS_API RRClass;
+class B10_LIBDNS_API RRTTL;
+class B10_LIBDNS_API RRType;
+class B10_LIBDNS_API Rcode;
 
 /// \brief A pointer-like type pointing to an \c EDNS object.
 typedef boost::shared_ptr<EDNS> EDNSPtr;
@@ -130,7 +132,7 @@ typedef boost::shared_ptr<const EDNS> ConstEDNSPtr;
 /// If a future version of the %EDNS protocol introduces further relationship
 /// between the message and the %EDNS, we might reconsider the interface,
 /// probably with higher abstraction.
-class EDNS : isc::util::nonassignable {
+class B10_LIBDNS_API EDNS : isc::util::nonassignable {
 public:
     ///
     /// \name Constructors and Destructor
@@ -423,9 +425,10 @@ private:
 /// \param extended_rcode A placeholder to store the topmost 8 bits of the
 /// extended Rcode.
 /// \return A pointer to the created \c EDNS object.
-EDNS* createEDNSFromRR(const Name& name, const RRClass& rrclass,
-                       const RRType& rrtype, const RRTTL& ttl,
-                       const rdata::Rdata& rdata, uint8_t& extended_rcode);
+B10_LIBDNS_API EDNS*
+createEDNSFromRR(const Name& name, const RRClass& rrclass,
+                 const RRType& rrtype, const RRTTL& ttl,
+                 const rdata::Rdata& rdata, uint8_t& extended_rcode);
 
 /// \brief Insert the \c EDNS as a string into stream.
 ///
@@ -437,7 +440,8 @@ EDNS* createEDNSFromRR(const Name& name, const RRClass& rrclass,
 /// \param edns A reference to an \c EDNS object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const EDNS& edns);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const EDNS& edns);
 }
 }
 #endif  // __EDNS_H
diff --git a/src/lib/dns/exceptions.cc b/src/lib/dns/exceptions.cc
index eb823b9..bc13e16 100644
--- a/src/lib/dns/exceptions.cc
+++ b/src/lib/dns/exceptions.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <dns/exceptions.h>
 #include <dns/rcode.h>
 
diff --git a/src/lib/dns/exceptions.h b/src/lib/dns/exceptions.h
index bd696a5..0f1d6b0 100644
--- a/src/lib/dns/exceptions.h
+++ b/src/lib/dns/exceptions.h
@@ -21,6 +21,7 @@
 #define __DNS_EXCEPTIONS_H 1
 
 #include <exceptions/exceptions.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
@@ -28,23 +29,23 @@ namespace dns {
 ///
 /// \brief A standard DNS module exception ...[TBD]
 ///
-class Rcode;                    // forward declaration
+class B10_LIBDNS_API Rcode;    // forward declaration
 
-class DNSProtocolError : public isc::Exception {
+class B10_LIBDNS_API DNSProtocolError : public isc::Exception {
 public:
     DNSProtocolError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
     virtual const Rcode& getRcode() const = 0;
 };
 
-class DNSMessageFORMERR : public DNSProtocolError {
+class B10_LIBDNS_API DNSMessageFORMERR : public DNSProtocolError {
 public:
     DNSMessageFORMERR(const char* file, size_t line, const char* what) :
         DNSProtocolError(file, line, what) {}
     virtual const Rcode& getRcode() const;
 };
 
-class DNSMessageBADVERS : public DNSProtocolError {
+class B10_LIBDNS_API DNSMessageBADVERS : public DNSProtocolError {
 public:
     DNSMessageBADVERS(const char* file, size_t line, const char* what) :
         DNSProtocolError(file, line, what) {}
diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc
index d9faf80..2987422 100644
--- a/src/lib/dns/labelsequence.cc
+++ b/src/lib/dns/labelsequence.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <dns/labelsequence.h>
 #include <dns/name_internal.h>
 #include <exceptions/exceptions.h>
@@ -395,7 +397,7 @@ LabelSequence::extend(const LabelSequence& labels,
     last_label_ = label_count + append_label_count - 1;
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const LabelSequence& label_sequence) {
     os << label_sequence.toText();
     return (os);
diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h
index 56787ae..31baf1b 100644
--- a/src/lib/dns/labelsequence.h
+++ b/src/lib/dns/labelsequence.h
@@ -15,6 +15,7 @@
 #ifndef __LABELSEQUENCE_H
 #define __LABELSEQUENCE_H 1
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <util/buffer.h>
 #include <util/nonassignable.h>
@@ -41,7 +42,7 @@ namespace dns {
 /// LabelSequences can be compared to other LabelSequences, and their
 /// data can be requested (which then points to part of the original
 /// data of the original Name object).
-class LabelSequence {
+class B10_LIBDNS_API LabelSequence {
     // Name calls the private toText(bool) method of LabelSequence.
     friend std::string Name::toText(bool) const;
 
@@ -372,7 +373,7 @@ private:
 /// \param label_sequence The \c LabelSequence object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const LabelSequence& label_sequence);
 
 } // end namespace dns
diff --git a/src/lib/dns/masterload.cc b/src/lib/dns/masterload.cc
index 3deae19..2e0965f 100644
--- a/src/lib/dns/masterload.cc
+++ b/src/lib/dns/masterload.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <istream>
 #include <fstream>
 #include <sstream>
@@ -61,7 +63,7 @@ stripLine(string& s, const Exception& ex) {
 }
 }
 
-void
+B10_LIBDNS_API void
 masterLoad(const char* const filename, const Name& origin,
            const RRClass& zone_class, MasterLoadCallback callback)
 {
@@ -79,7 +81,7 @@ masterLoad(const char* const filename, const Name& origin,
     ifs.close();
 }
 
-void
+B10_LIBDNS_API void
 masterLoad(istream& input, const Name& origin, const RRClass& zone_class,
            MasterLoadCallback callback)
 {
diff --git a/src/lib/dns/masterload.h b/src/lib/dns/masterload.h
index 41d145b..1e2e99e 100644
--- a/src/lib/dns/masterload.h
+++ b/src/lib/dns/masterload.h
@@ -21,16 +21,17 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/dll.h>
 #include <dns/rrset.h>
 
 namespace isc {
 namespace dns {
-class Name;
-class RRClass;
+class B10_LIBDNS_API Name;
+class B10_LIBDNS_API RRClass;
 
 /// \brief An exception that is thrown if an error occurs while loading a
 /// master zone data.
-class MasterLoadError : public isc::Exception {
+class B10_LIBDNS_API MasterLoadError : public isc::Exception {
 public:
     MasterLoadError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -214,8 +215,9 @@ typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 /// \param zone_class The RR class of the zone.
 /// \param callback A callback functor or function that is to be called
 /// for each RRset.
-void masterLoad(const char* const filename, const Name& origin,
-                const RRClass& zone_class, MasterLoadCallback callback);
+B10_LIBDNS_API void
+masterLoad(const char* const filename, const Name& origin,
+           const RRClass& zone_class, MasterLoadCallback callback);
 
 /// Master zone file loader from input stream.
 ///
@@ -232,8 +234,9 @@ void masterLoad(const char* const filename, const Name& origin,
 /// \param zone_class The RR class of the zone.
 /// \param callback A callback functor or function that is to be called for
 /// each RRset.
-void masterLoad(std::istream& input, const Name& origin,
-                const RRClass& zone_class, MasterLoadCallback callback);
+B10_LIBDNS_API void
+masterLoad(std::istream& input, const Name& origin,
+           const RRClass& zone_class, MasterLoadCallback callback);
 }
 //@}
 }
diff --git a/src/lib/dns/message.cc b/src/lib/dns/message.cc
index b88b76e..f72d12f 100644
--- a/src/lib/dns/message.cc
+++ b/src/lib/dns/message.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <algorithm>
@@ -1152,7 +1154,7 @@ Message::endSection(const Section section) const {
     return (RRsetIterator(RRsetIteratorImpl(impl_->rrsets_[section].end())));
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(ostream& os, const Message& message) {
     return (os << message.toText());
 }
diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h
index 73d0c6e..4db9d10 100644
--- a/src/lib/dns/message.h
+++ b/src/lib/dns/message.h
@@ -23,25 +23,28 @@
 
 #include <exceptions/exceptions.h>
 
+#include <util/dll.h>
+
+#include <dns/dll.h>
 #include <dns/edns.h>
 #include <dns/question.h>
 #include <dns/rrset.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
+class B10_LIBUTIL_API InputBuffer;
 }
 
 namespace dns {
-class TSIGContext;
-class TSIGRecord;
+class B10_LIBDNS_API TSIGContext;
+class B10_LIBDNS_API TSIGRecord;
 
 ///
 /// \brief A standard DNS module exception that is thrown if a wire format
 /// message parser encounters a short length of data that don't even contain
 /// the full header section.
 ///
-class MessageTooShort : public Exception {
+class B10_LIBDNS_API MessageTooShort : public Exception {
 public:
     MessageTooShort(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -52,7 +55,7 @@ public:
 /// is being constructed for an incompatible section.  Specifically, this
 /// happens RRset iterator is being constructed for a Question section.
 ///
-class InvalidMessageSection : public Exception {
+class B10_LIBDNS_API InvalidMessageSection : public Exception {
 public:
     InvalidMessageSection(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -63,7 +66,7 @@ public:
 /// class method is called that is prohibited for the current mode of
 /// the message.
 ///
-class InvalidMessageOperation : public Exception {
+class B10_LIBDNS_API InvalidMessageOperation : public Exception {
 public:
     InvalidMessageOperation(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -74,7 +77,7 @@ public:
 /// smaller than the standard default maximum (DEFAULT_MAX_UDPSIZE) is
 /// being specified for the message.
 ///
-class InvalidMessageUDPSize : public Exception {
+class B10_LIBDNS_API InvalidMessageUDPSize : public Exception {
 public:
     InvalidMessageUDPSize(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -82,11 +85,11 @@ public:
 
 typedef uint16_t qid_t;
 
-class AbstractMessageRenderer;
-class Message;
+class B10_LIBDNS_API AbstractMessageRenderer;
+class B10_LIBDNS_API Message;
 class MessageImpl;
-class Opcode;
-class Rcode;
+class B10_LIBDNS_API Opcode;
+class B10_LIBDNS_API Rcode;
 
 template <typename T>
 struct SectionIteratorImpl;
@@ -116,6 +119,9 @@ private:
 typedef SectionIterator<QuestionPtr> QuestionIterator;
 typedef SectionIterator<RRsetPtr> RRsetIterator;
 
+class B10_LIBDNS_API QuestionIteratorChild : public QuestionIterator {};
+class B10_LIBDNS_API RRsetIteratorChild : public RRsetIterator {};
+
 /// \brief The \c Message class encapsulates a standard DNS message.
 ///
 /// Details of the design and interfaces of this class are still in flux.
@@ -148,7 +154,7 @@ typedef SectionIterator<RRsetPtr> RRsetIterator;
 ///   so the implementation can only be moderately efficient.
 /// - We may want to provide a "find" method for a specified type
 ///   of RR in the message.
-class Message {
+class B10_LIBDNS_API Message {
 public:
     /// Constants to specify the operation mode of the \c Message.
     enum Mode {
@@ -681,7 +687,8 @@ typedef boost::shared_ptr<const Message> ConstMessagePtr;
 /// \param message A \c Message object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Message& message);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Message& message);
 }
 }
 #endif  // __MESSAGE_H
diff --git a/src/lib/dns/messagerenderer.cc b/src/lib/dns/messagerenderer.cc
index 28a5e8b..88e6393 100644
--- a/src/lib/dns/messagerenderer.cc
+++ b/src/lib/dns/messagerenderer.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 #include <util/buffer.h>
 #include <util/nonassignable.h>
diff --git a/src/lib/dns/messagerenderer.h b/src/lib/dns/messagerenderer.h
index 5a81eb2..2976df6 100644
--- a/src/lib/dns/messagerenderer.h
+++ b/src/lib/dns/messagerenderer.h
@@ -16,13 +16,14 @@
 #define __MESSAGERENDERER_H 1
 
 #include <util/buffer.h>
+#include <dns/dll.h>
 
 namespace isc {
 
 namespace dns {
 // forward declarations
-class Name;
-class LabelSequence;
+class B10_LIBDNS_API Name;
+class B10_LIBDNS_API LabelSequence;
 
 /// \brief The \c AbstractMessageRenderer class is an abstract base class
 /// that provides common interfaces for rendering a DNS message into a buffer
@@ -71,7 +72,7 @@ class LabelSequence;
 ///     The only one that is virtual is writeName and it's because this
 ///     function is much more complicated, therefore there's a lot of space
 ///     for different implementations or behaviours.
-class AbstractMessageRenderer {
+class B10_LIBDNS_API AbstractMessageRenderer {
 public:
     /// \brief Compression mode constants.
     ///
@@ -346,7 +347,7 @@ public:
 /// end of the buffer at the time of construction.  However, if the
 /// pre-existing portion of the buffer contains DNS names, these names won't
 /// be considered for name compression.
-class MessageRenderer : public AbstractMessageRenderer {
+class B10_LIBDNS_API MessageRenderer : public AbstractMessageRenderer {
 public:
     using AbstractMessageRenderer::CASE_INSENSITIVE;
     using AbstractMessageRenderer::CASE_SENSITIVE;
diff --git a/src/lib/dns/name.cc b/src/lib/dns/name.cc
index 5ea339d..0587de1 100644
--- a/src/lib/dns/name.cc
+++ b/src/lib/dns/name.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <cctype>
 #include <cassert>
 #include <iterator>
@@ -632,7 +634,7 @@ Name::downcase() {
     return (*this);
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Name& name) {
     os << name.toText();
     return (os);
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index 4f95b45..69cfc07 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -21,20 +21,22 @@
 #include <vector>
 
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief Base class for name parser exceptions.
 ///
-class NameParserException : public Exception {
+class B10_LIBDNS_API NameParserException : public Exception {
 public:
     NameParserException(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -44,7 +46,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters an empty label in the middle of a name.
 ///
-class EmptyLabel : public NameParserException {
+class B10_LIBDNS_API EmptyLabel : public NameParserException {
 public:
     EmptyLabel(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -54,7 +56,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters too long a name.
 ///
-class TooLongName : public NameParserException {
+class B10_LIBDNS_API TooLongName : public NameParserException {
 public:
     TooLongName(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -64,7 +66,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// encounters too long a label.
 ///
-class TooLongLabel : public NameParserException {
+class B10_LIBDNS_API TooLongLabel : public NameParserException {
 public:
     TooLongLabel(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -76,7 +78,7 @@ public:
 /// applies to bitstring labels, which would begin with "\[".  Incomplete cases
 /// include an incomplete escaped sequence such as "\12".
 ///
-class BadLabelType : public NameParserException {
+class B10_LIBDNS_API BadLabelType : public NameParserException {
 public:
     BadLabelType(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -86,7 +88,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if the name parser
 /// fails to decode a "\"-escaped sequence.
 ///
-class BadEscape : public NameParserException {
+class B10_LIBDNS_API BadEscape : public NameParserException {
 public:
     BadEscape(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -99,7 +101,7 @@ public:
 /// An attempt of constructing a name from an empty string will trigger this
 /// exception.
 ///
-class IncompleteName : public NameParserException {
+class B10_LIBDNS_API IncompleteName : public NameParserException {
 public:
     IncompleteName(const char* file, size_t line, const char* what) :
         NameParserException(file, line, what) {}
@@ -120,7 +122,7 @@ public:
 /// For example, two non absolute (or "relative") sequences "example.com" and
 /// "example.org" have no hierarchical relationship, and the former should be
 /// sorted before (i.e. "smaller") than the latter.
-class NameComparisonResult {
+class B10_LIBDNS_API NameComparisonResult {
 public:
     /// The relation of two names under comparison.
     /// Its semantics for the case of
@@ -226,7 +228,7 @@ private:
 /// introduce a parser of master files, we'll introduce the notion of relative
 /// names as a special case.
 ///
-class Name {
+class B10_LIBDNS_API Name {
     // LabelSequences use knowledge about the internal data structure
     // of this class for efficiency (they use the offsets_ vector and
     // the ndata_ string)
@@ -719,7 +721,7 @@ Name::ROOT_NAME() {
 /// \param name The \c Name object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Name& name);
 
 }
diff --git a/src/lib/dns/name_internal.h b/src/lib/dns/name_internal.h
index 8595df1..bdc41d5 100644
--- a/src/lib/dns/name_internal.h
+++ b/src/lib/dns/name_internal.h
@@ -15,6 +15,8 @@
 #ifndef __NAME_INTERNAL_H
 #define __NAME_INTERNAL_H 1
 
+#include <dns/dll.h>
+
 // This is effectively a "private" namespace for the Name class implementation,
 // but exposed publicly so the definitions in it can be shared with other
 // modules of the library (as of its introduction, used by LabelSequence and
diff --git a/src/lib/dns/nsec3hash.cc b/src/lib/dns/nsec3hash.cc
index 1754b69..ebdb720 100644
--- a/src/lib/dns/nsec3hash.cc
+++ b/src/lib/dns/nsec3hash.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <cassert>
@@ -185,7 +187,7 @@ DefaultNSEC3HashCreator::create(const generic::NSEC3& nsec3) const {
                                  nsec3.getSalt()));
 }
 
-void
+B10_LIBDNS_API void
 setNSEC3HashCreator(const NSEC3HashCreator* new_creator) {
     creator = new_creator;
 }
diff --git a/src/lib/dns/nsec3hash.h b/src/lib/dns/nsec3hash.h
index 2056708..74412ab 100644
--- a/src/lib/dns/nsec3hash.h
+++ b/src/lib/dns/nsec3hash.h
@@ -18,15 +18,16 @@
 #include <string>
 
 #include <exceptions/exceptions.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
-class Name;
+class B10_LIBDNS_API Name;
 
 namespace rdata {
 namespace generic {
-class NSEC3;
-class NSEC3PARAM;
+class B10_LIBDNS_API NSEC3;
+class B10_LIBDNS_API NSEC3PARAM;
 }
 }
 
@@ -36,7 +37,7 @@ class NSEC3PARAM;
 /// A specific exception class is used so that the caller can selectively
 /// catch this exception, e.g., while loading a zone, and handle it
 /// accordingly.
-class UnknownNSEC3HashAlgorithm : public isc::Exception {
+class B10_LIBDNS_API UnknownNSEC3HashAlgorithm : public isc::Exception {
 public:
     UnknownNSEC3HashAlgorithm(const char* file, size_t line,
                               const char* what) :
@@ -77,7 +78,7 @@ public:
 /// - Allow producing hash value as binary data
 /// - Allow updating NSEC3 parameters of a class object so we can still reuse
 ///   the internal resources for different sets of parameters.
-class NSEC3Hash {
+class B10_LIBDNS_API NSEC3Hash {
 protected:
     /// \brief The default constructor.
     ///
@@ -182,7 +183,7 @@ public:
 /// as const member functions for this reason.  But if we see the need for
 /// having a customized creator that benefits from its own state in future,
 /// this condition can be loosened.
-class NSEC3HashCreator {
+class B10_LIBDNS_API NSEC3HashCreator {
 protected:
     /// \brief The default constructor.
     ///
@@ -221,7 +222,7 @@ public:
 /// convenience of special applications that want to customize the creator
 /// behavior for a particular type of parameters while preserving the default
 /// behavior for others.
-class DefaultNSEC3HashCreator : public NSEC3HashCreator {
+class B10_LIBDNS_API DefaultNSEC3HashCreator : public NSEC3HashCreator {
 public:
     virtual NSEC3Hash* create(const rdata::generic::NSEC3PARAM& param) const;
     virtual NSEC3Hash* create(const rdata::generic::NSEC3& nsec3) const;
@@ -242,7 +243,7 @@ public:
 ///
 /// \exception None
 /// \param new_creator A pointer to the new creator object or NULL.
-void setNSEC3HashCreator(const NSEC3HashCreator* new_creator);
+B10_LIBDNS_API void setNSEC3HashCreator(const NSEC3HashCreator* new_creator);
 
 }
 }
diff --git a/src/lib/dns/opcode.cc b/src/lib/dns/opcode.cc
index 570dd81..2e88137 100644
--- a/src/lib/dns/opcode.cc
+++ b/src/lib/dns/opcode.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <string>
 #include <ostream>
 
@@ -59,7 +61,7 @@ Opcode::toText() const {
     return (opcodetext[code_]);
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Opcode& opcode) {
     return (os << opcode.toText());
 }
diff --git a/src/lib/dns/opcode.h b/src/lib/dns/opcode.h
index dd88062..73ff2c7 100644
--- a/src/lib/dns/opcode.h
+++ b/src/lib/dns/opcode.h
@@ -18,6 +18,8 @@
 
 #include <ostream>
 
+#include <dns/dll.h>
+
 #ifndef __OPCODE_H
 #define __OPCODE_H 1
 
@@ -37,7 +39,7 @@ namespace dns {
 /// to handle OPCODEs through this class.  In fact, public interfaces of
 /// this library uses this class to pass or return OPCODEs instead of the
 /// bare code values.
-class Opcode {
+class B10_LIBDNS_API Opcode {
 public:
     /// Constants for standard OPCODE values.
     enum CodeValue {
@@ -280,7 +282,8 @@ Opcode::RESERVED15() {
 /// \param opcode A reference to an \c Opcode object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Opcode& opcode);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Opcode& opcode);
 }
 }
 #endif  // OPCODE_H
diff --git a/src/lib/dns/python/Makefile.am b/src/lib/dns/python/Makefile.am
index 6dd94b6..eb29e5b 100644
--- a/src/lib/dns/python/Makefile.am
+++ b/src/lib/dns/python/Makefile.am
@@ -5,7 +5,8 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 lib_LTLIBRARIES = libb10-pydnspp.la
-libb10_pydnspp_la_SOURCES = pydnspp_common.cc pydnspp_common.h pydnspp_towire.h
+libb10_pydnspp_la_SOURCES  = dll.h pydnspp_towire.h
+libb10_pydnspp_la_SOURCES += pydnspp_common.cc pydnspp_common.h
 libb10_pydnspp_la_SOURCES += name_python.cc name_python.h
 libb10_pydnspp_la_SOURCES += nsec3hash_python.cc nsec3hash_python.h
 libb10_pydnspp_la_SOURCES += rrset_python.cc rrset_python.h
diff --git a/src/lib/dns/python/dll.h b/src/lib/dns/python/dll.h
new file mode 100644
index 0000000..559786a
--- /dev/null
+++ b/src/lib/dns/python/dll.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBDNS_PYTHON_H
+#define __LIBDNS_PYTHON_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBDNS_PYTHON_API
+#else
+#ifdef B10_LIBDNS_PYTHON_EXPORT
+#define B10_LIBDNS_PYTHON_API __declspec(dllexport)
+#else
+#define B10_LIBDNS_PYTHON_API __declspec(dllimport)
+#endif
+#endif
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK) || defined(USE_STATIC_WRAPPER)
+#define B10_PYTHON_WRAPPER_API
+#else
+#ifdef B10_LIBDNS_PYTHON_EXPORT
+#define B10_PYTHON_WRAPPER_API __declspec(dllexport)
+#else
+#define B10_PYTHON_WRAPPER_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBDNS_PYTHON_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/dns/python/edns_python.cc b/src/lib/dns/python/edns_python.cc
index 8f0f1a4..8b7de26 100644
--- a/src/lib/dns/python/edns_python.cc
+++ b/src/lib/dns/python/edns_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <cassert>
@@ -312,7 +314,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_EDNS
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject edns_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject edns_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.EDNS",
     sizeof(s_EDNS),                     // tp_basicsize
@@ -363,14 +365,14 @@ PyTypeObject edns_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createEDNSObject(const EDNS& source) {
     EDNSContainer container(PyObject_New(s_EDNS, &edns_type));
     container.set(new EDNS(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyEDNS_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -378,7 +380,7 @@ PyEDNS_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &edns_type));
 }
 
-const EDNS&
+B10_LIBDNS_PYTHON_API const EDNS&
 PyEDNS_ToEDNS(const PyObject* edns_obj) {
     if (edns_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/edns_python.h b/src/lib/dns/python/edns_python.h
index 30d92ab..b20e7ec 100644
--- a/src/lib/dns/python/edns_python.h
+++ b/src/lib/dns/python/edns_python.h
@@ -17,13 +17,16 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class EDNS;
+class B10_LIBDNS_API EDNS;
 
 namespace python {
 
-extern PyTypeObject edns_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject edns_type;
 
 /// This is a simple shortcut to create a python EDNS object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +35,7 @@ extern PyTypeObject edns_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createEDNSObject(const EDNS& source);
+B10_LIBDNS_PYTHON_API PyObject* createEDNSObject(const EDNS& source);
 
 /// \brief Checks if the given python object is a EDNS object
 ///
@@ -40,7 +43,7 @@ PyObject* createEDNSObject(const EDNS& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type EDNS, false otherwise
-bool PyEDNS_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyEDNS_Check(PyObject* obj);
 
 /// \brief Returns a reference to the EDNS object contained within the given
 ///        Python object.
@@ -52,7 +55,7 @@ bool PyEDNS_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param edns_obj The edns object to convert
-const EDNS& PyEDNS_ToEDNS(const PyObject* edns_obj);
+B10_LIBDNS_PYTHON_API const EDNS& PyEDNS_ToEDNS(const PyObject* edns_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/message_python.cc b/src/lib/dns/python/message_python.cc
index f08f62c..a46e9d2 100644
--- a/src/lib/dns/python/message_python.cc
+++ b/src/lib/dns/python/message_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
@@ -789,15 +791,15 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_MessageTooShort;
-PyObject* po_InvalidMessageSection;
-PyObject* po_InvalidMessageOperation;
-PyObject* po_InvalidMessageUDPSize;
+B10_LIBDNS_PYTHON_API PyObject* po_MessageTooShort;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageSection;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageOperation;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageUDPSize;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Message
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject message_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject message_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Message",
     sizeof(s_Message),                  // tp_basicsize
diff --git a/src/lib/dns/python/message_python.h b/src/lib/dns/python/message_python.h
index be23890..e41dbdb 100644
--- a/src/lib/dns/python/message_python.h
+++ b/src/lib/dns/python/message_python.h
@@ -17,18 +17,21 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Message;
+class B10_LIBDNS_API Message;
 
 namespace python {
 
-extern PyObject* po_MessageTooShort;
-extern PyObject* po_InvalidMessageSection;
-extern PyObject* po_InvalidMessageOperation;
-extern PyObject* po_InvalidMessageUDPSize;
+extern B10_LIBDNS_PYTHON_API PyObject* po_MessageTooShort;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageSection;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageOperation;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidMessageUDPSize;
 
-extern PyTypeObject message_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject message_type;
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/messagerenderer_python.cc b/src/lib/dns/python/messagerenderer_python.cc
index 5561c12..334cdb4 100644
--- a/src/lib/dns/python/messagerenderer_python.cc
+++ b/src/lib/dns/python/messagerenderer_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/buffer.h>
@@ -180,7 +182,7 @@ MessageRenderer_clear(s_MessageRenderer* self) {
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject messagerenderer_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject messagerenderer_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.MessageRenderer",
     sizeof(s_MessageRenderer),          // tp_basicsize
@@ -239,7 +241,7 @@ PyTypeObject messagerenderer_type = {
 // copy the existing buffer into a new one, then create a new renderer with
 // that buffer?
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyMessageRenderer_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -247,7 +249,7 @@ PyMessageRenderer_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &messagerenderer_type));
 }
 
-MessageRenderer&
+B10_LIBDNS_PYTHON_API MessageRenderer&
 PyMessageRenderer_ToMessageRenderer(PyObject* messagerenderer_obj) {
     if (messagerenderer_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/messagerenderer_python.h b/src/lib/dns/python/messagerenderer_python.h
index ea9a940..2cda308 100644
--- a/src/lib/dns/python/messagerenderer_python.h
+++ b/src/lib/dns/python/messagerenderer_python.h
@@ -18,14 +18,16 @@
 #include <Python.h>
 
 #include <util/buffer.h>
+#include <dns/dll.h>
+#include <dns/python/dll.h>
 
 namespace isc {
 namespace dns {
-class MessageRenderer;
+class B10_LIBDNS_API MessageRenderer;
 
 namespace python {
 
-extern PyTypeObject messagerenderer_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject messagerenderer_type;
 
 /// \brief Checks if the given python object is a MessageRenderer object
 ///
@@ -33,7 +35,7 @@ extern PyTypeObject messagerenderer_type;
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type MessageRenderer, false otherwise
-bool PyMessageRenderer_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyMessageRenderer_Check(PyObject* obj);
 
 /// \brief Returns a reference to the MessageRenderer object contained within the given
 ///        Python object.
@@ -45,7 +47,8 @@ bool PyMessageRenderer_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param messagerenderer_obj The messagerenderer object to convert
-MessageRenderer& PyMessageRenderer_ToMessageRenderer(PyObject* messagerenderer_obj);
+B10_LIBDNS_PYTHON_API MessageRenderer&
+PyMessageRenderer_ToMessageRenderer(PyObject* messagerenderer_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/name_python.cc b/src/lib/dns/python/name_python.cc
index 2799db9..68bb399 100644
--- a/src/lib/dns/python/name_python.cc
+++ b/src/lib/dns/python/name_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/buffer.h>
@@ -537,23 +539,23 @@ namespace python {
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_EmptyLabel;
-PyObject* po_TooLongName;
-PyObject* po_TooLongLabel;
-PyObject* po_BadLabelType;
-PyObject* po_BadEscape;
-PyObject* po_IncompleteName;
-PyObject* po_InvalidBufferPosition;
-PyObject* po_DNSMessageFORMERR;
+B10_LIBDNS_PYTHON_API PyObject* po_EmptyLabel;
+B10_LIBDNS_PYTHON_API PyObject* po_TooLongName;
+B10_LIBDNS_PYTHON_API PyObject* po_TooLongLabel;
+B10_LIBDNS_PYTHON_API PyObject* po_BadLabelType;
+B10_LIBDNS_PYTHON_API PyObject* po_BadEscape;
+B10_LIBDNS_PYTHON_API PyObject* po_IncompleteName;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidBufferPosition;
+B10_LIBDNS_PYTHON_API PyObject* po_DNSMessageFORMERR;
 
 //
 // Definition of enums
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_NameRelation;
+B10_LIBDNS_PYTHON_API PyObject* po_NameRelation;
 
-PyTypeObject name_comparison_result_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject name_comparison_result_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.NameComparisonResult",
     sizeof(s_NameComparisonResult),           // tp_basicsize
@@ -609,7 +611,7 @@ PyTypeObject name_comparison_result_type = {
     0                                         // tp_version_tag
 };
 
-PyTypeObject name_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject name_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Name",
     sizeof(s_Name),                     // tp_basicsize
@@ -664,14 +666,14 @@ PyTypeObject name_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createNameObject(const Name& source) {
     NameContainer container(PyObject_New(s_Name, &name_type));
     container.set(new Name(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyName_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -679,7 +681,7 @@ PyName_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &name_type));
 }
 
-const Name&
+B10_LIBDNS_PYTHON_API const Name&
 PyName_ToName(const PyObject* name_obj) {
     if (name_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/name_python.h b/src/lib/dns/python/name_python.h
index 86d7fd0..221f16f 100644
--- a/src/lib/dns/python/name_python.h
+++ b/src/lib/dns/python/name_python.h
@@ -17,30 +17,33 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Name;
+class B10_LIBDNS_API Name;
 
 namespace python {
 
-extern PyObject* po_EmptyLabel;
-extern PyObject* po_TooLongName;
-extern PyObject* po_TooLongLabel;
-extern PyObject* po_BadLabelType;
-extern PyObject* po_BadEscape;
-extern PyObject* po_IncompleteName;
-extern PyObject* po_InvalidBufferPosition;
-extern PyObject* po_DNSMessageFORMERR;
+extern B10_LIBDNS_PYTHON_API PyObject* po_EmptyLabel;
+extern B10_LIBDNS_PYTHON_API PyObject* po_TooLongName;
+extern B10_LIBDNS_PYTHON_API PyObject* po_TooLongLabel;
+extern B10_LIBDNS_PYTHON_API PyObject* po_BadLabelType;
+extern B10_LIBDNS_PYTHON_API PyObject* po_BadEscape;
+extern B10_LIBDNS_PYTHON_API PyObject* po_IncompleteName;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidBufferPosition;
+extern B10_LIBDNS_PYTHON_API PyObject* po_DNSMessageFORMERR;
 
 //
 // Declaration of enums
 // Initialization and addition of these go in the module init at the
 // end
 //
-extern PyObject* po_NameRelation;
+extern B10_LIBDNS_PYTHON_API PyObject* po_NameRelation;
 
-extern PyTypeObject name_comparison_result_type;
-extern PyTypeObject name_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject name_comparison_result_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject name_type;
 
 /// This is A simple shortcut to create a python Name object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -49,7 +52,7 @@ extern PyTypeObject name_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createNameObject(const Name& source);
+B10_LIBDNS_PYTHON_API PyObject* createNameObject(const Name& source);
 
 /// \brief Checks if the given python object is a Name object
 ///
@@ -57,7 +60,7 @@ PyObject* createNameObject(const Name& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Name, false otherwise
-bool PyName_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyName_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Name object contained within the given
 ///        Python object.
@@ -69,7 +72,7 @@ bool PyName_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param name_obj The name object to convert
-const Name& PyName_ToName(const PyObject* name_obj);
+B10_LIBDNS_PYTHON_API const Name& PyName_ToName(const PyObject* name_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/nsec3hash_python.cc b/src/lib/dns/python/nsec3hash_python.cc
index 01e8ae5..1c62f94 100644
--- a/src/lib/dns/python/nsec3hash_python.cc
+++ b/src/lib/dns/python/nsec3hash_python.cc
@@ -18,6 +18,9 @@
 
 // Python.h needs to be placed at the head of the program file, see:
 // http://docs.python.org/py3k/extending/extending.html#a-simple-example
+
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -194,12 +197,12 @@ namespace python {
 // Declaration of the custom exceptions
 // Initialization and addition of these go in pydnspp.cc
 //
-PyObject* po_UnknownNSEC3HashAlgorithm;
+B10_LIBDNS_PYTHON_API PyObject* po_UnknownNSEC3HashAlgorithm;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_NSEC3Hash
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject nsec3hash_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject nsec3hash_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "dns.NSEC3Hash",
     sizeof(s_NSEC3Hash),                 // tp_basicsize
@@ -250,7 +253,7 @@ PyTypeObject nsec3hash_type = {
 };
 
 // Module Initialization, all statics (nothing right now) are initialized here
-bool
+B10_LIBDNS_PYTHON_API bool
 initModulePart_NSEC3Hash(PyObject* mod) {
     // We initialize the static description object with PyType_Ready(),
     // then add it to the module. This is not just a check! (leaving
diff --git a/src/lib/dns/python/nsec3hash_python.h b/src/lib/dns/python/nsec3hash_python.h
index fa9b9b6..3e763e0 100644
--- a/src/lib/dns/python/nsec3hash_python.h
+++ b/src/lib/dns/python/nsec3hash_python.h
@@ -17,9 +17,12 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class NSEC3Hash;
+class B10_LIBDNS_API NSEC3Hash;
 
 namespace python {
 
@@ -30,12 +33,12 @@ public:
     NSEC3Hash* cppobj;
 };
 
-extern PyTypeObject nsec3hash_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject nsec3hash_type;
 
 // Public exception object.
-extern PyObject* po_UnknownNSEC3HashAlgorithm;
+extern B10_LIBDNS_PYTHON_API PyObject* po_UnknownNSEC3HashAlgorithm;
 
-bool initModulePart_NSEC3Hash(PyObject* mod);
+B10_LIBDNS_PYTHON_API bool initModulePart_NSEC3Hash(PyObject* mod);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/opcode_python.cc b/src/lib/dns/python/opcode_python.cc
index 50436a9..f4a5036 100644
--- a/src/lib/dns/python/opcode_python.cc
+++ b/src/lib/dns/python/opcode_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/opcode.h>
@@ -290,7 +292,7 @@ namespace isc {
 namespace dns {
 namespace python {
 
-PyTypeObject opcode_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject opcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Opcode",
     sizeof(s_Opcode),                   // tp_basicsize
@@ -341,14 +343,14 @@ PyTypeObject opcode_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createOpcodeObject(const Opcode& source) {
     OpcodeContainer container(PyObject_New(s_Opcode, &opcode_type));
     container.set(new Opcode(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyOpcode_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -356,7 +358,7 @@ PyOpcode_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &opcode_type));
 }
 
-const Opcode&
+B10_LIBDNS_PYTHON_API const Opcode&
 PyOpcode_ToOpcode(const PyObject* opcode_obj) {
     if (opcode_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/opcode_python.h b/src/lib/dns/python/opcode_python.h
index d0aec15..1a8ce3e 100644
--- a/src/lib/dns/python/opcode_python.h
+++ b/src/lib/dns/python/opcode_python.h
@@ -17,13 +17,16 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Opcode;
+class B10_LIBDNS_API Opcode;
 
 namespace python {
 
-extern PyTypeObject opcode_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject opcode_type;
 
 /// This is a simple shortcut to create a python Opcode object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +35,7 @@ extern PyTypeObject opcode_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createOpcodeObject(const Opcode& source);
+B10_LIBDNS_PYTHON_API PyObject* createOpcodeObject(const Opcode& source);
 
 /// \brief Checks if the given python object is a Opcode object
 ///
@@ -40,7 +43,7 @@ PyObject* createOpcodeObject(const Opcode& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Opcode, false otherwise
-bool PyOpcode_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyOpcode_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Opcode object contained within the given
 ///        Python object.
@@ -52,7 +55,8 @@ bool PyOpcode_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param opcode_obj The opcode object to convert
-const Opcode& PyOpcode_ToOpcode(const PyObject* opcode_obj);
+B10_LIBDNS_PYTHON_API const Opcode&
+PyOpcode_ToOpcode(const PyObject* opcode_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/pydnspp_common.cc b/src/lib/dns/python/pydnspp_common.cc
index 8e623c5..7aa728b 100644
--- a/src/lib/dns/python/pydnspp_common.cc
+++ b/src/lib/dns/python/pydnspp_common.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <exceptions/exceptions.h>
@@ -46,14 +48,14 @@ namespace isc {
 namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
-PyObject* po_IscException;
-PyObject* po_InvalidParameter;
+B10_LIBDNS_PYTHON_API PyObject* po_IscException;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception
-PyObject* po_DNSMessageBADVERS;
+B10_LIBDNS_PYTHON_API PyObject* po_DNSMessageBADVERS;
 
 
-int
+B10_LIBDNS_PYTHON_API int
 readDataFromSequence(uint8_t *data, size_t len, PyObject* sequence) {
     PyObject* el = NULL;
     for (size_t i = 0; i < len; i++) {
@@ -82,7 +84,7 @@ readDataFromSequence(uint8_t *data, size_t len, PyObject* sequence) {
 }
 
 
-int
+B10_LIBDNS_PYTHON_API int
 addClassVariable(PyTypeObject& c, const char* name, PyObject* obj) {
     if (obj == NULL) {
         PyErr_SetString(PyExc_ValueError,
diff --git a/src/lib/dns/python/pydnspp_common.h b/src/lib/dns/python/pydnspp_common.h
index 3cc69c4..23ae936 100644
--- a/src/lib/dns/python/pydnspp_common.h
+++ b/src/lib/dns/python/pydnspp_common.h
@@ -23,15 +23,17 @@
 #include <stdexcept>
 #include <string>
 
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
 namespace python {
 // For our 'general' isc::Exceptions
-extern PyObject* po_IscException;
-extern PyObject* po_InvalidParameter;
+extern B10_LIBDNS_PYTHON_API PyObject* po_IscException;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidParameter;
 
 // For our own isc::dns::Exception
-extern PyObject* po_DNSMessageBADVERS;
+extern B10_LIBDNS_PYTHON_API PyObject* po_DNSMessageBADVERS;
 
 // This function reads 'bytes' from a sequence
 // This sequence can be anything that implements the Sequence interface,
@@ -43,8 +45,10 @@ extern PyObject* po_DNSMessageBADVERS;
 // The current implementation removes read items from the
 // head of the sequence, unless it fails (and returns -1), in which
 // case nothing is removed
+B10_LIBDNS_PYTHON_API
 int readDataFromSequence(uint8_t *data, size_t len, PyObject* sequence);
 
+B10_LIBDNS_PYTHON_API
 int addClassVariable(PyTypeObject& c, const char* name, PyObject* obj);
 
 // Short term workaround for unifying the return type of tp_hash
diff --git a/src/lib/dns/python/pydnspp_towire.h b/src/lib/dns/python/pydnspp_towire.h
index 286e433..6c74545 100644
--- a/src/lib/dns/python/pydnspp_towire.h
+++ b/src/lib/dns/python/pydnspp_towire.h
@@ -20,6 +20,7 @@
 #include <stdexcept>
 #include <string>
 
+#include <dns/python/dll.h>
 #include <dns/messagerenderer.h>
 
 #include <util/nonassignable.h>
diff --git a/src/lib/dns/python/question_python.cc b/src/lib/dns/python/question_python.cc
index 44d68a2..20e297e 100644
--- a/src/lib/dns/python/question_python.cc
+++ b/src/lib/dns/python/question_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <dns/question.h>
@@ -239,7 +241,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Question
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject question_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject question_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Question",
     sizeof(s_Question),                 // tp_basicsize
@@ -290,7 +292,7 @@ PyTypeObject question_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createQuestionObject(const Question& source) {
     s_Question* question =
         static_cast<s_Question*>(question_type.tp_alloc(&question_type, 0));
@@ -298,7 +300,7 @@ createQuestionObject(const Question& source) {
     return (question);
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyQuestion_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -306,7 +308,7 @@ PyQuestion_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &question_type));
 }
 
-const Question&
+B10_LIBDNS_PYTHON_API const Question&
 PyQuestion_ToQuestion(const PyObject* question_obj) {
     if (question_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/question_python.h b/src/lib/dns/python/question_python.h
index f5d78b1..c4abbfa 100644
--- a/src/lib/dns/python/question_python.h
+++ b/src/lib/dns/python/question_python.h
@@ -17,15 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Question;
+class B10_LIBDNS_API Question;
 
 namespace python {
 
-extern PyObject* po_EmptyQuestion;
+extern B10_LIBDNS_PYTHON_API PyObject* po_EmptyQuestion;
 
-extern PyTypeObject question_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject question_type;
 
 /// This is a simple shortcut to create a python Question object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -34,7 +37,7 @@ extern PyTypeObject question_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createQuestionObject(const Question& source);
+B10_LIBDNS_PYTHON_API PyObject* createQuestionObject(const Question& source);
 
 /// \brief Checks if the given python object is a Question object
 ///
@@ -42,7 +45,7 @@ PyObject* createQuestionObject(const Question& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Question, false otherwise
-bool PyQuestion_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyQuestion_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Question object contained within the given
 ///        Python object.
@@ -54,7 +57,8 @@ bool PyQuestion_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param question_obj The question object to convert
-const Question& PyQuestion_ToQuestion(const PyObject* question_obj);
+B10_LIBDNS_PYTHON_API const Question&
+PyQuestion_ToQuestion(const PyObject* question_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/rcode_python.cc b/src/lib/dns/python/rcode_python.cc
index 42b48e7..12446b5 100644
--- a/src/lib/dns/python/rcode_python.cc
+++ b/src/lib/dns/python/rcode_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <exceptions/exceptions.h>
@@ -330,7 +332,7 @@ Rcode_richcmp(const s_Rcode* const self, const s_Rcode* const other,
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject rcode_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rcode_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Rcode",
     sizeof(s_Rcode),                    // tp_basicsize
@@ -381,14 +383,14 @@ PyTypeObject rcode_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRcodeObject(const Rcode& source) {
     RcodeContainer container(PyObject_New(s_Rcode, &rcode_type));
     container.set(new Rcode(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRcode_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -396,7 +398,7 @@ PyRcode_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rcode_type));
 }
 
-const Rcode&
+B10_LIBDNS_PYTHON_API const Rcode&
 PyRcode_ToRcode(const PyObject* rcode_obj) {
     if (rcode_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rcode_python.h b/src/lib/dns/python/rcode_python.h
index a149406..c516978 100644
--- a/src/lib/dns/python/rcode_python.h
+++ b/src/lib/dns/python/rcode_python.h
@@ -17,13 +17,16 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Rcode;
+class B10_LIBDNS_API Rcode;
 
 namespace python {
 
-extern PyTypeObject rcode_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rcode_type;
 
 /// This is a simple shortcut to create a python Rcode object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +35,7 @@ extern PyTypeObject rcode_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRcodeObject(const Rcode& source);
+B10_LIBDNS_PYTHON_API PyObject* createRcodeObject(const Rcode& source);
 
 /// \brief Checks if the given python object is a Rcode object
 ///
@@ -40,7 +43,7 @@ PyObject* createRcodeObject(const Rcode& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Rcode, false otherwise
-bool PyRcode_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRcode_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Rcode object contained within the given
 ///        Python object.
@@ -52,7 +55,7 @@ bool PyRcode_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rcode_obj The rcode object to convert
-const Rcode& PyRcode_ToRcode(const PyObject* rcode_obj);
+B10_LIBDNS_PYTHON_API const Rcode& PyRcode_ToRcode(const PyObject* rcode_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/rdata_python.cc b/src/lib/dns/python/rdata_python.cc
index 20f67c8..dcd0375 100644
--- a/src/lib/dns/python/rdata_python.cc
+++ b/src/lib/dns/python/rdata_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <dns/rdata.h>
@@ -284,14 +286,14 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp
 //
-PyObject* po_InvalidRdataLength;
-PyObject* po_InvalidRdataText;
-PyObject* po_CharStringTooLong;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidRdataLength;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidRdataText;
+B10_LIBDNS_PYTHON_API PyObject* po_CharStringTooLong;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Rdata
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rdata_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rdata_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Rdata",
     sizeof(s_Rdata),                    // tp_basicsize
@@ -342,7 +344,7 @@ PyTypeObject rdata_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRdataObject(ConstRdataPtr source) {
     s_Rdata* py_rdata =
         static_cast<s_Rdata*>(rdata_type.tp_alloc(&rdata_type, 0));
@@ -354,7 +356,7 @@ createRdataObject(ConstRdataPtr source) {
     return (py_rdata);
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRdata_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -362,7 +364,7 @@ PyRdata_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rdata_type));
 }
 
-const Rdata&
+B10_LIBDNS_PYTHON_API const Rdata&
 PyRdata_ToRdata(const PyObject* rdata_obj) {
     if (rdata_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rdata_python.h b/src/lib/dns/python/rdata_python.h
index c7ddd57..d930e49 100644
--- a/src/lib/dns/python/rdata_python.h
+++ b/src/lib/dns/python/rdata_python.h
@@ -17,17 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/python/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
 namespace dns {
 namespace python {
 
-extern PyObject* po_InvalidRdataLength;
-extern PyObject* po_InvalidRdataText;
-extern PyObject* po_CharStringTooLong;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidRdataLength;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidRdataText;
+extern B10_LIBDNS_PYTHON_API PyObject* po_CharStringTooLong;
 
-extern PyTypeObject rdata_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rdata_type;
 
 /// This is a simple shortcut to create a python Rdata object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -36,7 +37,8 @@ extern PyTypeObject rdata_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRdataObject(isc::dns::rdata::ConstRdataPtr source);
+B10_LIBDNS_PYTHON_API PyObject*
+createRdataObject(isc::dns::rdata::ConstRdataPtr source);
 
 /// \brief Checks if the given python object is a Rdata object
 ///
@@ -44,7 +46,7 @@ PyObject* createRdataObject(isc::dns::rdata::ConstRdataPtr source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Rdata, false otherwise
-bool PyRdata_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRdata_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Rdata object contained within the given
 ///        Python object.
@@ -56,7 +58,8 @@ bool PyRdata_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rdata_obj The rdata object to convert
-const isc::dns::rdata::Rdata& PyRdata_ToRdata(const PyObject* rdata_obj);
+B10_LIBDNS_PYTHON_API const isc::dns::rdata::Rdata&
+PyRdata_ToRdata(const PyObject* rdata_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/rrclass_python.cc b/src/lib/dns/python/rrclass_python.cc
index a566f47..0d6bce2 100644
--- a/src/lib/dns/python/rrclass_python.cc
+++ b/src/lib/dns/python/rrclass_python.cc
@@ -11,6 +11,9 @@
 // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/rrclass.h>
@@ -282,14 +285,14 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_InvalidRRClass;
-PyObject* po_IncompleteRRClass;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRClass;
+B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRClass;
 
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRClass
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrclass_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rrclass_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRClass",
     sizeof(s_RRClass),                  // tp_basicsize
@@ -342,7 +345,7 @@ PyTypeObject rrclass_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRRClassObject(const RRClass& source) {
     RRClassContainer container(PyObject_New(s_RRClass, &rrclass_type));
     container.set(new RRClass(source));
@@ -350,7 +353,7 @@ createRRClassObject(const RRClass& source) {
 }
 
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRRClass_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -358,7 +361,7 @@ PyRRClass_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rrclass_type));
 }
 
-const RRClass&
+B10_LIBDNS_PYTHON_API const RRClass&
 PyRRClass_ToRRClass(const PyObject* rrclass_obj) {
     if (rrclass_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rrclass_python.h b/src/lib/dns/python/rrclass_python.h
index f58bba6..0b0b20e 100644
--- a/src/lib/dns/python/rrclass_python.h
+++ b/src/lib/dns/python/rrclass_python.h
@@ -17,16 +17,19 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class RRClass;
+class B10_LIBDNS_API RRClass;
 
 namespace python {
 
-extern PyObject* po_InvalidRRClass;
-extern PyObject* po_IncompleteRRClass;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRClass;
+extern B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRClass;
 
-extern PyTypeObject rrclass_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rrclass_type;
 
 /// This is a simple shortcut to create a python RRClass object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -35,7 +38,7 @@ extern PyTypeObject rrclass_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRRClassObject(const RRClass& source);
+B10_LIBDNS_PYTHON_API PyObject* createRRClassObject(const RRClass& source);
 
 /// \brief Checks if the given python object is a RRClass object
 ///
@@ -43,7 +46,7 @@ PyObject* createRRClassObject(const RRClass& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRClass, false otherwise
-bool PyRRClass_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRRClass_Check(PyObject* obj);
 
 /// \brief Returns a reference to the RRClass object contained within the given
 ///        Python object.
@@ -55,7 +58,8 @@ bool PyRRClass_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrclass_obj The rrclass object to convert
-const RRClass& PyRRClass_ToRRClass(const PyObject* rrclass_obj);
+B10_LIBDNS_PYTHON_API const RRClass&
+PyRRClass_ToRRClass(const PyObject* rrclass_obj);
 
 
 } // namespace python
diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc
index 2992522..29afecf 100644
--- a/src/lib/dns/python/rrset_python.cc
+++ b/src/lib/dns/python/rrset_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <util/python/pycppwrapper_util.h>
@@ -347,9 +349,9 @@ namespace python {
 // Initialization and addition of these go in the module init at the
 // end
 //
-PyObject* po_EmptyRRset;
+B10_LIBDNS_PYTHON_API PyObject* po_EmptyRRset;
 
-PyTypeObject rrset_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rrset_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRset",
     sizeof(s_RRset),                    // tp_basicsize
@@ -414,7 +416,7 @@ PyTypeObject rrset_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRRsetObject(const AbstractRRset& source) {
 
     // RRsets are noncopyable, so as a workaround we recreate a new one
@@ -442,7 +444,7 @@ createRRsetObject(const AbstractRRset& source) {
     return (py_rrset);
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRRset_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -450,13 +452,13 @@ PyRRset_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rrset_type));
 }
 
-AbstractRRset&
+B10_LIBDNS_PYTHON_API AbstractRRset&
 PyRRset_ToRRset(PyObject* rrset_obj) {
     s_RRset* rrset = static_cast<s_RRset*>(rrset_obj);
     return (*rrset->cppobj);
 }
 
-RRsetPtr
+B10_LIBDNS_PYTHON_API RRsetPtr
 PyRRset_ToRRsetPtr(PyObject* rrset_obj) {
     if (rrset_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rrset_python.h b/src/lib/dns/python/rrset_python.h
index 2435397..5826372 100644
--- a/src/lib/dns/python/rrset_python.h
+++ b/src/lib/dns/python/rrset_python.h
@@ -17,6 +17,7 @@
 
 #include <Python.h>
 
+#include <dns/python/dll.h>
 #include <dns/rrset.h>
 
 #include <util/python/pycppwrapper_util.h>
@@ -25,9 +26,9 @@ namespace isc {
 namespace dns {
 namespace python {
 
-extern PyObject* po_EmptyRRset;
+extern B10_LIBDNS_PYTHON_API PyObject* po_EmptyRRset;
 
-extern PyTypeObject rrset_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rrset_type;
 
 /// This is a simple shortcut to create a python RRset object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -36,7 +37,7 @@ extern PyTypeObject rrset_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRRsetObject(const AbstractRRset& source);
+B10_LIBDNS_PYTHON_API PyObject* createRRsetObject(const AbstractRRset& source);
 
 /// \brief Checks if the given python object is a RRset object
 ///
@@ -44,7 +45,7 @@ PyObject* createRRsetObject(const AbstractRRset& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRset, false otherwise
-bool PyRRset_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRRset_Check(PyObject* obj);
 
 /// \brief Returns a reference to the RRset object contained within the given
 ///        Python object.
@@ -56,7 +57,7 @@ bool PyRRset_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrset_obj The rrset object to convert
-AbstractRRset& PyRRset_ToRRset(PyObject* rrset_obj);
+B10_LIBDNS_PYTHON_API AbstractRRset& PyRRset_ToRRset(PyObject* rrset_obj);
 
 /// \brief Returns the shared_ptr of the RRset object contained within the
 ///        given Python object.
@@ -65,7 +66,7 @@ AbstractRRset& PyRRset_ToRRset(PyObject* rrset_obj);
 ///       either the right call to ParseTuple("O!"), or with PyRRset_Check()
 ///
 /// \param rrset_obj The rrset object to convert
-RRsetPtr PyRRset_ToRRsetPtr(PyObject* rrset_obj);
+B10_LIBDNS_PYTHON_API RRsetPtr PyRRset_ToRRsetPtr(PyObject* rrset_obj);
 
 
 } // namespace python
diff --git a/src/lib/dns/python/rrttl_python.cc b/src/lib/dns/python/rrttl_python.cc
index 3a3f067..79b552e 100644
--- a/src/lib/dns/python/rrttl_python.cc
+++ b/src/lib/dns/python/rrttl_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 #include <vector>
 
@@ -230,13 +232,13 @@ namespace python {
 // Initialization and addition of these go in the initModulePart
 // function in pydnspp.cc
 //
-PyObject* po_InvalidRRTTL;
-PyObject* po_IncompleteRRTTL;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRTTL;
+B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRTTL;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRTTL
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrttl_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rrttl_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRTTL",
     sizeof(s_RRTTL),                    // tp_basicsize
@@ -291,14 +293,14 @@ PyTypeObject rrttl_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRRTTLObject(const RRTTL& source) {
     RRTTLContainer container(PyObject_New(s_RRTTL, &rrttl_type));
     container.set(new RRTTL(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRRTTL_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -306,7 +308,7 @@ PyRRTTL_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rrttl_type));
 }
 
-const RRTTL&
+B10_LIBDNS_PYTHON_API const RRTTL&
 PyRRTTL_ToRRTTL(const PyObject* rrttl_obj) {
     if (rrttl_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rrttl_python.h b/src/lib/dns/python/rrttl_python.h
index 9dbc982..ef74ce3 100644
--- a/src/lib/dns/python/rrttl_python.h
+++ b/src/lib/dns/python/rrttl_python.h
@@ -17,16 +17,19 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class RRTTL;
+class B10_LIBDNS_API RRTTL;
 
 namespace python {
 
-extern PyObject* po_InvalidRRTTL;
-extern PyObject* po_IncompleteRRTTL;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRTTL;
+extern B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRTTL;
 
-extern PyTypeObject rrttl_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rrttl_type;
 
 /// This is a simple shortcut to create a python RRTTL object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -35,7 +38,7 @@ extern PyTypeObject rrttl_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRRTTLObject(const RRTTL& source);
+B10_LIBDNS_PYTHON_API PyObject* createRRTTLObject(const RRTTL& source);
 
 /// \brief Checks if the given python object is a RRTTL object
 ///
@@ -43,7 +46,7 @@ PyObject* createRRTTLObject(const RRTTL& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRTTL, false otherwise
-bool PyRRTTL_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRRTTL_Check(PyObject* obj);
 
 /// \brief Returns a reference to the RRTTL object contained within the given
 ///        Python object.
@@ -55,7 +58,7 @@ bool PyRRTTL_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrttl_obj The rrttl object to convert
-const RRTTL& PyRRTTL_ToRRTTL(const PyObject* rrttl_obj);
+B10_LIBDNS_PYTHON_API const RRTTL& PyRRTTL_ToRRTTL(const PyObject* rrttl_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/rrtype_python.cc b/src/lib/dns/python/rrtype_python.cc
index 97b66d4..222dd4f 100644
--- a/src/lib/dns/python/rrtype_python.cc
+++ b/src/lib/dns/python/rrtype_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 #include <vector>
 
@@ -380,13 +382,13 @@ namespace isc {
 namespace dns {
 namespace python {
 
-PyObject* po_InvalidRRType;
-PyObject* po_IncompleteRRType;
+B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRType;
+B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRType;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_RRType
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject rrtype_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject rrtype_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.RRType",
     sizeof(s_RRType),                   // tp_basicsize
@@ -439,14 +441,14 @@ PyTypeObject rrtype_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createRRTypeObject(const RRType& source) {
     RRTypeContainer container(PyObject_New(s_RRType, &rrtype_type));
     container.set(new RRType(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyRRType_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -454,7 +456,7 @@ PyRRType_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rrtype_type));
 }
 
-const RRType&
+B10_LIBDNS_PYTHON_API const RRType&
 PyRRType_ToRRType(const PyObject* rrtype_obj) {
     if (rrtype_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/rrtype_python.h b/src/lib/dns/python/rrtype_python.h
index 596598e..3ce4440 100644
--- a/src/lib/dns/python/rrtype_python.h
+++ b/src/lib/dns/python/rrtype_python.h
@@ -17,16 +17,19 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class RRType;
+class B10_LIBDNS_API RRType;
 
 namespace python {
 
-extern PyObject* po_InvalidRRType;
-extern PyObject* po_IncompleteRRType;
+extern B10_LIBDNS_PYTHON_API PyObject* po_InvalidRRType;
+extern B10_LIBDNS_PYTHON_API PyObject* po_IncompleteRRType;
 
-extern PyTypeObject rrtype_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject rrtype_type;
 
 /// This is a simple shortcut to create a python RRType object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -35,7 +38,7 @@ extern PyTypeObject rrtype_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRRTypeObject(const RRType& source);
+B10_LIBDNS_PYTHON_API PyObject* createRRTypeObject(const RRType& source);
 
 /// \brief Checks if the given python object is a RRType object
 ///
@@ -43,7 +46,7 @@ PyObject* createRRTypeObject(const RRType& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRType, false otherwise
-bool PyRRType_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyRRType_Check(PyObject* obj);
 
 /// \brief Returns a reference to the RRType object contained within the given
 ///        Python object.
@@ -55,7 +58,8 @@ bool PyRRType_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrtype_obj The rrtype object to convert
-const RRType& PyRRType_ToRRType(const PyObject* rrtype_obj);
+B10_LIBDNS_PYTHON_API const RRType&
+PyRRType_ToRRType(const PyObject* rrtype_obj);
 
 
 } // namespace python
diff --git a/src/lib/dns/python/serial_python.cc b/src/lib/dns/python/serial_python.cc
index e2bd809..b298632 100644
--- a/src/lib/dns/python/serial_python.cc
+++ b/src/lib/dns/python/serial_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <dns/serial.h>
@@ -193,7 +195,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_Serial
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject serial_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject serial_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.Serial",
     sizeof(s_Serial),                   // tp_basicsize
@@ -250,14 +252,14 @@ PyTypeObject serial_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createSerialObject(const Serial& source) {
     SerialContainer container(PyObject_New(s_Serial, &serial_type));
     container.set(new Serial(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PySerial_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException,
@@ -266,7 +268,7 @@ PySerial_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &serial_type));
 }
 
-const Serial&
+B10_LIBDNS_PYTHON_API const Serial&
 PySerial_ToSerial(const PyObject* serial_obj) {
     if (serial_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/serial_python.h b/src/lib/dns/python/serial_python.h
index 48b5199..541883a 100644
--- a/src/lib/dns/python/serial_python.h
+++ b/src/lib/dns/python/serial_python.h
@@ -17,13 +17,16 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class Serial;
+class B10_LIBDNS_API Serial;
 
 namespace python {
 
-extern PyTypeObject serial_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject serial_type;
 
 /// This is a simple shortcut to create a python Serial object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +35,7 @@ extern PyTypeObject serial_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createSerialObject(const Serial& source);
+B10_LIBDNS_PYTHON_API PyObject* createSerialObject(const Serial& source);
 
 /// \brief Checks if the given python object is a Serial object
 ///
@@ -40,7 +43,7 @@ PyObject* createSerialObject(const Serial& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Serial, false otherwise
-bool PySerial_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PySerial_Check(PyObject* obj);
 
 /// \brief Returns a reference to the Serial object contained within the given
 ///        Python object.
@@ -52,7 +55,8 @@ bool PySerial_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param Serial_obj The Serial object to convert
-const Serial& PySerial_ToSerial(const PyObject* Serial_obj);
+B10_LIBDNS_PYTHON_API const Serial&
+PySerial_ToSerial(const PyObject* Serial_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/tsig_python.cc b/src/lib/dns/python/tsig_python.cc
index 0764e33..9b51e87 100644
--- a/src/lib/dns/python/tsig_python.cc
+++ b/src/lib/dns/python/tsig_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN        // need for "y#" below
 #include <Python.h>
 
@@ -240,12 +242,12 @@ namespace isc {
 namespace dns {
 namespace python {
 // Definition of class specific exception(s)
-PyObject* po_TSIGContextError;
+B10_LIBDNS_PYTHON_API PyObject* po_TSIGContextError;
 
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGContext
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigcontext_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsigcontext_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGContext",
     sizeof(s_TSIGContext),                 // tp_basicsize
@@ -302,7 +304,7 @@ PyTypeObject tsigcontext_type = {
     0                                   // tp_version_tag
 };
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyTSIGContext_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -310,7 +312,7 @@ PyTSIGContext_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &tsigcontext_type));
 }
 
-TSIGContext&
+B10_LIBDNS_PYTHON_API TSIGContext&
 PyTSIGContext_ToTSIGContext(PyObject* tsigcontext_obj) {
     if (tsigcontext_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/tsig_python.h b/src/lib/dns/python/tsig_python.h
index e4e9fff..e0d2dd1 100644
--- a/src/lib/dns/python/tsig_python.h
+++ b/src/lib/dns/python/tsig_python.h
@@ -17,16 +17,19 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class TSIGContext;
+class B10_LIBDNS_API TSIGContext;
 
 namespace python {
 
-extern PyTypeObject tsigcontext_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsigcontext_type;
 
 // Class specific exceptions
-extern PyObject* po_TSIGContextError;
+extern B10_LIBDNS_PYTHON_API PyObject* po_TSIGContextError;
 
 /// \brief Checks if the given python object is a TSIGContext object
 ///
@@ -34,7 +37,7 @@ extern PyObject* po_TSIGContextError;
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGContext, false otherwise
-bool PyTSIGContext_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyTSIGContext_Check(PyObject* obj);
 
 /// \brief Returns a reference to the TSIGContext object contained within the given
 ///        Python object.
@@ -46,7 +49,8 @@ bool PyTSIGContext_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param tsigcontext_obj The tsigcontext object to convert
-TSIGContext& PyTSIGContext_ToTSIGContext(PyObject* tsigcontext_obj);
+B10_LIBDNS_PYTHON_API TSIGContext&
+PyTSIGContext_ToTSIGContext(PyObject* tsigcontext_obj);
 
 
 } // namespace python
diff --git a/src/lib/dns/python/tsig_rdata_python.cc b/src/lib/dns/python/tsig_rdata_python.cc
index 6ec0f09..4c4c441 100644
--- a/src/lib/dns/python/tsig_rdata_python.cc
+++ b/src/lib/dns/python/tsig_rdata_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
@@ -285,7 +287,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIG
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsig_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsig_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIG",
     sizeof(s_TSIG),                 // tp_basicsize
@@ -337,14 +339,14 @@ PyTypeObject tsig_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createTSIGObject(const any::TSIG& source) {
     TSIGContainer container(PyObject_New(s_TSIG, &tsig_type));
     container.set(new any::TSIG(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyTSIG_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -352,7 +354,7 @@ PyTSIG_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &tsig_type));
 }
 
-const any::TSIG&
+B10_LIBDNS_PYTHON_API const any::TSIG&
 PyTSIG_ToTSIG(const PyObject* tsig_obj) {
     if (tsig_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/tsig_rdata_python.h b/src/lib/dns/python/tsig_rdata_python.h
index a84d9e8..d3b4446 100644
--- a/src/lib/dns/python/tsig_rdata_python.h
+++ b/src/lib/dns/python/tsig_rdata_python.h
@@ -17,17 +17,20 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
 namespace rdata {
 namespace any {
-class TSIG;
+class B10_LIBDNS_API TSIG;
 }
 }
 
 namespace python {
 
-extern PyTypeObject tsig_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsig_type;
 
 /// This is A simple shortcut to create a python TSIG object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -36,7 +39,8 @@ extern PyTypeObject tsig_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createTSIGObject(const rdata::any::TSIG& source);
+B10_LIBDNS_PYTHON_API PyObject*
+createTSIGObject(const rdata::any::TSIG& source);
 
 /// \brief Checks if the given python object is a TSIG object
 ///
@@ -44,7 +48,7 @@ PyObject* createTSIGObject(const rdata::any::TSIG& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIG, false otherwise
-bool PyTSIG_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyTSIG_Check(PyObject* obj);
 
 /// \brief Returns a reference to the TSIG object contained within the given
 ///        Python object.
@@ -56,7 +60,8 @@ bool PyTSIG_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param tsig_obj The tsig object to convert
-const rdata::any::TSIG& PyTSIG_ToTSIG(const PyObject* tsig_obj);
+B10_LIBDNS_PYTHON_API const rdata::any::TSIG&
+PyTSIG_ToTSIG(const PyObject* tsig_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/tsigerror_python.cc b/src/lib/dns/python/tsigerror_python.cc
index 7a0217e..a1f55b3 100644
--- a/src/lib/dns/python/tsigerror_python.cc
+++ b/src/lib/dns/python/tsigerror_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -228,7 +230,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGError
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigerror_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsigerror_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGError",
     sizeof(s_TSIGError),                 // tp_basicsize
@@ -280,7 +282,7 @@ PyTypeObject tsigerror_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createTSIGErrorObject(const TSIGError& source) {
     TSIGErrorContainer container(PyObject_New(s_TSIGError, &tsigerror_type));
     container.set(new TSIGError(source));
diff --git a/src/lib/dns/python/tsigerror_python.h b/src/lib/dns/python/tsigerror_python.h
index 0b5b630..d18ded2 100644
--- a/src/lib/dns/python/tsigerror_python.h
+++ b/src/lib/dns/python/tsigerror_python.h
@@ -17,13 +17,16 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class TSIGError;
+class B10_LIBDNS_API TSIGError;
 
 namespace python {
 
-extern PyTypeObject tsigerror_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsigerror_type;
 
 /// This is A simple shortcut to create a python TSIGError object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -32,7 +35,7 @@ extern PyTypeObject tsigerror_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createTSIGErrorObject(const TSIGError& source);
+B10_LIBDNS_PYTHON_API PyObject* createTSIGErrorObject(const TSIGError& source);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/tsigkey_python.cc b/src/lib/dns/python/tsigkey_python.cc
index cf79c1a..78a8d80 100644
--- a/src/lib/dns/python/tsigkey_python.cc
+++ b/src/lib/dns/python/tsigkey_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <stdexcept>
@@ -181,7 +183,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_EDNS
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigkey_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsigkey_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGKey",
     sizeof(s_TSIGKey),                  // tp_basicsize
@@ -232,7 +234,7 @@ PyTypeObject tsigkey_type = {
     0                                   // tp_version_tag
 };
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyTSIGKey_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -240,7 +242,7 @@ PyTSIGKey_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &tsigkey_type));
 }
 
-const TSIGKey&
+B10_LIBDNS_PYTHON_API const TSIGKey&
 PyTSIGKey_ToTSIGKey(const PyObject* tsigkey_obj) {
     const s_TSIGKey* tsigkey = static_cast<const s_TSIGKey*>(tsigkey_obj);
     return (*tsigkey->cppobj);
@@ -394,7 +396,7 @@ TSIGKeyRing_find(const s_TSIGKeyRing* self, PyObject* args) {
 namespace isc {
 namespace dns {
 namespace python {
-PyTypeObject tsigkeyring_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsigkeyring_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGKeyRing",
     sizeof(s_TSIGKeyRing),              // tp_basicsize
@@ -444,7 +446,7 @@ PyTypeObject tsigkeyring_type = {
     0                                   // tp_version_tag
 };
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyTSIGKeyRing_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -452,7 +454,7 @@ PyTSIGKeyRing_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &tsigkeyring_type));
 }
 
-const TSIGKeyRing&
+B10_LIBDNS_PYTHON_API const TSIGKeyRing&
 PyTSIGKeyRing_ToTSIGKeyRing(const PyObject* tsigkeyring_obj) {
     if (tsigkeyring_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/tsigkey_python.h b/src/lib/dns/python/tsigkey_python.h
index 6c3d2e3..74848b8 100644
--- a/src/lib/dns/python/tsigkey_python.h
+++ b/src/lib/dns/python/tsigkey_python.h
@@ -17,15 +17,18 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class TSIGKey;
-class TSIGKeyRing;
+class B10_LIBDNS_API TSIGKey;
+class B10_LIBDNS_API TSIGKeyRing;
 
 namespace python {
 
-extern PyTypeObject tsigkey_type;
-extern PyTypeObject tsigkeyring_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsigkey_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsigkeyring_type;
 
 /// \brief Checks if the given python object is a TSIGKey object
 ///
@@ -33,7 +36,7 @@ extern PyTypeObject tsigkeyring_type;
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGKey, false otherwise
-bool PyTSIGKey_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyTSIGKey_Check(PyObject* obj);
 
 /// \brief Returns a reference to the TSIGKey object contained within the given
 ///        Python object.
@@ -45,13 +48,14 @@ bool PyTSIGKey_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param tsigkey_obj The tsigkey object to convert
-const TSIGKey& PyTSIGKey_ToTSIGKey(const PyObject* tsigkey_obj);
+B10_LIBDNS_PYTHON_API const TSIGKey&
+PyTSIGKey_ToTSIGKey(const PyObject* tsigkey_obj);
 
 /// \brief Checks if the given python object is a TSIGKeyRing object
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGKeyRing, false otherwise
-bool PyTSIGKeyRing_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyTSIGKeyRing_Check(PyObject* obj);
 
 /// \brief Returns a reference to the TSIGKeyRing object contained within the given
 ///        Python object.
@@ -63,7 +67,8 @@ bool PyTSIGKeyRing_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param tsigkeyring_obj The tsigkeyring object to convert
-const TSIGKeyRing& PyTSIGKeyRing_ToTSIGKeyRing(const PyObject* tsigkeyring_obj);
+B10_LIBDNS_PYTHON_API const TSIGKeyRing&
+PyTSIGKeyRing_ToTSIGKeyRing(const PyObject* tsigkeyring_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/python/tsigrecord_python.cc b/src/lib/dns/python/tsigrecord_python.cc
index c754dd2..b3b7d09 100644
--- a/src/lib/dns/python/tsigrecord_python.cc
+++ b/src/lib/dns/python/tsigrecord_python.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_PYTHON_EXPORT
+
 #include <Python.h>
 
 #include <string>
@@ -212,7 +214,7 @@ namespace python {
 // This defines the complete type for reflection in python and
 // parsing of PyObject* to s_TSIGRecord
 // Most of the functions are not actually implemented and NULL here.
-PyTypeObject tsigrecord_type = {
+B10_LIBDNS_PYTHON_API PyTypeObject tsigrecord_type = {
     PyVarObject_HEAD_INIT(NULL, 0)
     "pydnspp.TSIGRecord",
     sizeof(s_TSIGRecord),                 // tp_basicsize
@@ -262,14 +264,14 @@ PyTypeObject tsigrecord_type = {
     0                                   // tp_version_tag
 };
 
-PyObject*
+B10_LIBDNS_PYTHON_API PyObject*
 createTSIGRecordObject(const TSIGRecord& source) {
     TSIGRecordContainer container(PyObject_New(s_TSIGRecord, &tsigrecord_type));
     container.set(new TSIGRecord(source));
     return (container.release());
 }
 
-bool
+B10_LIBDNS_PYTHON_API bool
 PyTSIGRecord_Check(PyObject* obj) {
     if (obj == NULL) {
         isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
@@ -277,7 +279,7 @@ PyTSIGRecord_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &tsigrecord_type));
 }
 
-const TSIGRecord&
+B10_LIBDNS_PYTHON_API const TSIGRecord&
 PyTSIGRecord_ToTSIGRecord(PyObject* tsigrecord_obj) {
     if (tsigrecord_obj == NULL) {
         isc_throw(PyCPPWrapperException,
diff --git a/src/lib/dns/python/tsigrecord_python.h b/src/lib/dns/python/tsigrecord_python.h
index d6252e1..b85d271 100644
--- a/src/lib/dns/python/tsigrecord_python.h
+++ b/src/lib/dns/python/tsigrecord_python.h
@@ -17,14 +17,17 @@
 
 #include <Python.h>
 
+#include <dns/dll.h>
+#include <dns/python/dll.h>
+
 namespace isc {
 namespace dns {
-class TSIGRecord;
+class B10_LIBDNS_API TSIGRecord;
 
 namespace python {
 
 
-extern PyTypeObject tsigrecord_type;
+extern B10_LIBDNS_PYTHON_API PyTypeObject tsigrecord_type;
 
 /// This is A simple shortcut to create a python TSIGRecord object (in the
 /// form of a pointer to PyObject) with minimal exception safety.
@@ -33,7 +36,8 @@ extern PyTypeObject tsigrecord_type;
 /// returns a NULL pointer).
 /// This function is expected to be called with in a try block
 /// followed by necessary setup for python exception.
-PyObject* createTSIGRecordObject(const TSIGRecord& source);
+B10_LIBDNS_PYTHON_API PyObject*
+createTSIGRecordObject(const TSIGRecord& source);
 
 /// \brief Checks if the given python object is a TSIGRecord object
 ///
@@ -41,7 +45,7 @@ PyObject* createTSIGRecordObject(const TSIGRecord& source);
 ///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGRecord, false otherwise
-bool PyTSIGRecord_Check(PyObject* obj);
+B10_LIBDNS_PYTHON_API bool PyTSIGRecord_Check(PyObject* obj);
 
 /// \brief Returns a reference to the TSIGRecord object contained within the given
 ///        Python object.
@@ -53,7 +57,8 @@ bool PyTSIGRecord_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrtype_obj The rrtype object to convert
-const TSIGRecord& PyTSIGRecord_ToTSIGRecord(PyObject* tsigrecord_obj);
+B10_LIBDNS_PYTHON_API const TSIGRecord&
+PyTSIGRecord_ToTSIGRecord(PyObject* tsigrecord_obj);
 
 } // namespace python
 } // namespace dns
diff --git a/src/lib/dns/question.cc b/src/lib/dns/question.cc
index 6ccb164..7df444c 100644
--- a/src/lib/dns/question.cc
+++ b/src/lib/dns/question.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <iostream>
 #include <string>
 
@@ -73,7 +75,7 @@ Question::toWire(AbstractMessageRenderer& renderer) const {
     return (1);                 // number of "entries"
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Question& question) {
     os << question.toText();
     return (os);
diff --git a/src/lib/dns/question.h b/src/lib/dns/question.h
index 5d2783b..da97453 100644
--- a/src/lib/dns/question.h
+++ b/src/lib/dns/question.h
@@ -20,20 +20,22 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <util/dll.h>
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
 
-class AbstractMessageRenderer;
-class Question;
+class B10_LIBDNS_API AbstractMessageRenderer;
+class B10_LIBDNS_API Question;
 
 /// \brief A pointer-like type pointing to an \c Question object.
 typedef boost::shared_ptr<Question> QuestionPtr;
@@ -100,7 +102,7 @@ typedef boost::shared_ptr<const Question> ConstQuestionPtr;
 /// \c AbstractRRset such as \c %getName() or \c %toWire().
 /// So the user class may use a template function that is applicable to both
 /// \c Question and \c RRset to avoid writing duplicate code logic.
-class Question {
+class B10_LIBDNS_API Question {
     ///
     /// \name Constructors and Destructor
     ///
@@ -285,7 +287,8 @@ private:
 /// operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Question& question);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Question& question);
 } // end of namespace dns
 } // end of namespace isc
 #endif  // __QUESTION_H
diff --git a/src/lib/dns/rcode.cc b/src/lib/dns/rcode.cc
index ee41b1e..a4701cd 100644
--- a/src/lib/dns/rcode.cc
+++ b/src/lib/dns/rcode.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <string>
 #include <sstream>
 #include <ostream>
@@ -93,7 +95,7 @@ Rcode::toText() const {
     return (oss.str());
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(std::ostream& os, const Rcode& rcode) {
     return (os << rcode.toText());
 }
diff --git a/src/lib/dns/rcode.h b/src/lib/dns/rcode.h
index 0c63285..1031c1a 100644
--- a/src/lib/dns/rcode.h
+++ b/src/lib/dns/rcode.h
@@ -18,6 +18,8 @@
 
 #include <ostream>
 
+#include <dns/dll.h>
+
 #ifndef __RCODE_H
 #define __RCODE_H 1
 
@@ -45,7 +47,7 @@ namespace dns {
 /// to handle RCODEs through this class.  In fact, public interfaces of
 /// this library uses this class to pass or return RCODEs instead of the
 /// bare code values.
-class Rcode {
+class B10_LIBDNS_API Rcode {
 public:
     /// Constants for pre-defined RCODE values.
     enum CodeValue {
@@ -336,7 +338,8 @@ Rcode::BADVERS() {
 /// \param rcode A reference to an \c Rcode object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Rcode& rcode);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Rcode& rcode);
 }
 }
 #endif  // RCODE_H
diff --git a/src/lib/dns/rdata.cc b/src/lib/dns/rdata.cc
index c7eaa13..e2016dc 100644
--- a/src/lib/dns/rdata.cc
+++ b/src/lib/dns/rdata.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <algorithm>
 #include <cctype>
 #include <string>
@@ -44,7 +46,7 @@ namespace rdata {
 
 // XXX: we need to specify std:: for string to help doxygen match the
 // function signature with that given in the header file.
-RdataPtr
+B10_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass,
             const std::string& rdata_string)
 {
@@ -52,7 +54,7 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
                                                        rdata_string));
 }
 
-RdataPtr
+B10_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass,
             isc::util::InputBuffer& buffer, size_t len)
 {
@@ -74,14 +76,14 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
     return (rdata);
 }
 
-RdataPtr
+B10_LIBDNS_API RdataPtr
 createRdata(const RRType& rrtype, const RRClass& rrclass, const Rdata& source)
 {
     return (RRParamRegistry::getRegistry().createRdata(rrtype, rrclass,
                                                        source));
 }
 
-int
+B10_LIBDNS_API int
 compareNames(const Name& n1, const Name& n2) {
     size_t len1 = n1.getLength();
     size_t len2 = n2.getLength();
@@ -263,7 +265,7 @@ Generic::compare(const Rdata& other) const {
     return (compare_internal(*impl_, *other_rdata.impl_));
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Generic& rdata) {
     return (os << rdata.toText());
 }
diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h
index ac6efc3..e50fc3e 100644
--- a/src/lib/dns/rdata.h
+++ b/src/lib/dns/rdata.h
@@ -19,20 +19,21 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <util/dll.h>
 #include <util/noncopyable.h>
-
 #include <exceptions/exceptions.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
-class RRType;
-class RRClass;
-class Name;
+class B10_LIBDNS_API AbstractMessageRenderer;
+class B10_LIBDNS_API RRType;
+class B10_LIBDNS_API RRClass;
+class B10_LIBDNS_API Name;
 
 namespace rdata {
 
@@ -40,7 +41,7 @@ namespace rdata {
 /// \brief A standard DNS module exception that is thrown if RDATA parser
 /// encounters an invalid or inconsistent data length.
 ///
-class InvalidRdataLength : public Exception {
+class B10_LIBDNS_API InvalidRdataLength : public Exception {
 public:
     InvalidRdataLength(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -50,7 +51,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if RDATA parser
 /// fails to recognize a given textual representation.
 ///
-class InvalidRdataText : public Exception {
+class B10_LIBDNS_API InvalidRdataText : public Exception {
 public:
     InvalidRdataText(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -61,14 +62,14 @@ public:
 /// parser encounters a character-string (as defined in RFC1035) exceeding
 /// the maximum allowable length (\c MAX_CHARSTRING_LEN).
 ///
-class CharStringTooLong : public Exception {
+class B10_LIBDNS_API CharStringTooLong : public Exception {
 public:
     CharStringTooLong(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
 // Forward declaration to define RdataPtr.
-class Rdata;
+class B10_LIBDNS_API Rdata;
 
 ///
 /// The \c RdataPtr type is a pointer-like type, pointing to an
@@ -126,7 +127,7 @@ const unsigned int MAX_CHARSTRING_LEN = 255;
 /// specifically concerned about a particular type.
 /// So, this API generally handles \c Rdata in a polymorphic way through
 /// a pointer or reference to this base abstract class.
-class Rdata : isc::util::noncopyable {
+class B10_LIBDNS_API Rdata : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
@@ -231,7 +232,7 @@ struct GenericImpl;
 /// This class is used as a placeholder for all non well-known type of RDATA.
 /// By definition, the stored data is regarded as opaque binary without
 /// assuming any structure.
-class Generic : public Rdata {
+class B10_LIBDNS_API Generic : public Rdata {
 public:
     ///
     /// \name Constructors, Assignment Operator and Destructor.
@@ -381,7 +382,8 @@ private:
 /// \param rdata The \c Generic object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Generic& rdata);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Generic& rdata);
 } // end of namespace "generic"
 
 //
@@ -426,8 +428,9 @@ std::ostream& operator<<(std::ostream& os, const Generic& rdata);
 /// \param rdata_string A string of textual representation of the \c Rdata.
 /// \return An \c RdataPtr object pointing to the created \c Rdata
 /// object.
-RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
-                     const std::string& rdata_string);
+B10_LIBDNS_API RdataPtr
+createRdata(const RRType& rrtype, const RRClass& rrclass,
+            const std::string& rdata_string);
 
 /// \brief Create RDATA of a given pair of RR type and class from
 /// wire-format data.
@@ -450,8 +453,9 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// \param len The length in buffer of the \c Rdata.  In bytes.
 /// \return An \c RdataPtr object pointing to the created \c Rdata
 /// object.
-RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
-                     isc::util::InputBuffer& buffer, size_t len);
+B10_LIBDNS_API RdataPtr
+createRdata(const RRType& rrtype, const RRClass& rrclass,
+            isc::util::InputBuffer& buffer, size_t len);
 
 /// \brief Create RDATA of a given pair of RR type and class, copying
 /// of another RDATA of same kind.
@@ -466,8 +470,9 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// is to be copied to the created \c Rdata object.
 /// \return An \c RdataPtr object pointing to the created
 /// \c Rdata object.
-RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
-                     const Rdata& source);
+B10_LIBDNS_API RdataPtr
+createRdata(const RRType& rrtype, const RRClass& rrclass,
+            const Rdata& source);
 //@}
 
 ///
@@ -500,7 +505,7 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 /// \return 0 if \c n1 is identical to \c n2 in terms of sorting order.
 /// \return 1 if \c n1 would be sorted after \c n2.
 ///
-int compareNames(const Name& n1, const Name& n2);
+B10_LIBDNS_API int compareNames(const Name& n1, const Name& n2);
 
 } // end of namespace "rdata"
 }
diff --git a/src/lib/dns/rdata/any_255/tsig_250.h b/src/lib/dns/rdata/any_255/tsig_250.h
index ff24925..261c7e3 100644
--- a/src/lib/dns/rdata/any_255/tsig_250.h
+++ b/src/lib/dns/rdata/any_255/tsig_250.h
@@ -18,11 +18,12 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
 namespace dns {
-class Name;
+class B10_LIBDNS_API Name;
 }
 }
 
@@ -39,7 +40,7 @@ class Name;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// TSIG RDATA.
-class TSIG : public Rdata {
+class B10_LIBDNS_API TSIG : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/ch_3/a_1.h b/src/lib/dns/rdata/ch_3/a_1.h
index 6d75952..55ae81d 100644
--- a/src/lib/dns/rdata/ch_3/a_1.h
+++ b/src/lib/dns/rdata/ch_3/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class B10_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/afsdb_18.h b/src/lib/dns/rdata/generic/afsdb_18.h
index 4a46775..45c7650 100644
--- a/src/lib/dns/rdata/generic/afsdb_18.h
+++ b/src/lib/dns/rdata/generic/afsdb_18.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -34,7 +35,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// AFSDB RDATA.
-class AFSDB : public Rdata {
+class B10_LIBDNS_API AFSDB : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/cname_5.h b/src/lib/dns/rdata/generic/cname_5.h
index 92dffad..bc605d0 100644
--- a/src/lib/dns/rdata/generic/cname_5.h
+++ b/src/lib/dns/rdata/generic/cname_5.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class CNAME : public Rdata {
+class B10_LIBDNS_API CNAME : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index b5a35cd..09ad27d 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -26,6 +26,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/dll.h>
 #include <dns/messagerenderer.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
index 6eea2c7..17ae550 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <util/encode/hex.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.h b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
index 85b1c13..de765d4 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.h
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
@@ -17,6 +17,7 @@
 
 #include <util/nonassignable.h>
 #include <util/buffer.h>
+#include <dns/dll.h>
 
 #include <stdint.h>
 
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
index bb48705..4c0b9e9 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <exceptions/exceptions.h>
 
 #include <dns/exceptions.h>
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
index 85cae2e..41532b9 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.h
@@ -20,6 +20,8 @@
 #include <sstream>
 #include <vector>
 
+#include <dns/dll.h>
+
 namespace isc {
 namespace dns {
 namespace rdata {
diff --git a/src/lib/dns/rdata/generic/detail/txt_like.h b/src/lib/dns/rdata/generic/detail/txt_like.h
index a0ab7ac..edbd92e 100644
--- a/src/lib/dns/rdata/generic/detail/txt_like.h
+++ b/src/lib/dns/rdata/generic/detail/txt_like.h
@@ -20,6 +20,8 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
+
 using namespace std;
 using namespace isc::util;
 
diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h
index 86cd98c..fecfefc 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.h
+++ b/src/lib/dns/rdata/generic/dlv_32769.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -40,7 +41,7 @@ template <class Type, uint16_t typeCode> class DSLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DLV RDATA.
-class DLV : public Rdata {
+class B10_LIBDNS_API DLV : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/dname_39.h b/src/lib/dns/rdata/generic/dname_39.h
index 5e12167..cfa424d 100644
--- a/src/lib/dns/rdata/generic/dname_39.h
+++ b/src/lib/dns/rdata/generic/dname_39.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class DNAME : public Rdata {
+class B10_LIBDNS_API DNAME : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/dnskey_48.h b/src/lib/dns/rdata/generic/dnskey_48.h
index 14fad9f..ec704f4 100644
--- a/src/lib/dns/rdata/generic/dnskey_48.h
+++ b/src/lib/dns/rdata/generic/dnskey_48.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct DNSKEYImpl;
 
-class DNSKEY : public Rdata {
+class B10_LIBDNS_API DNSKEY : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ds_43.h b/src/lib/dns/rdata/generic/ds_43.h
index 2697f51..3b8c15e 100644
--- a/src/lib/dns/rdata/generic/ds_43.h
+++ b/src/lib/dns/rdata/generic/ds_43.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -40,7 +41,7 @@ template <class Type, uint16_t typeCode> class DSLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DS RDATA.
-class DS : public Rdata {
+class B10_LIBDNS_API DS : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/hinfo_13.h b/src/lib/dns/rdata/generic/hinfo_13.h
index 8513419..acecd28 100644
--- a/src/lib/dns/rdata/generic/hinfo_13.h
+++ b/src/lib/dns/rdata/generic/hinfo_13.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
@@ -34,7 +35,7 @@
 /// This class implements the basic interfaces inherited from the
 /// \c rdata::Rdata class, and provides accessors specific to the
 /// HINFO rdata.
-class HINFO : public Rdata {
+class B10_LIBDNS_API HINFO : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/minfo_14.h b/src/lib/dns/rdata/generic/minfo_14.h
index f3ee1d0..2c860c2 100644
--- a/src/lib/dns/rdata/generic/minfo_14.h
+++ b/src/lib/dns/rdata/generic/minfo_14.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// MINFO RDATA.
-class MINFO : public Rdata {
+class B10_LIBDNS_API MINFO : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/mx_15.h b/src/lib/dns/rdata/generic/mx_15.h
index 1381f18..03291c4 100644
--- a/src/lib/dns/rdata/generic/mx_15.h
+++ b/src/lib/dns/rdata/generic/mx_15.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -28,7 +29,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class MX : public Rdata {
+class B10_LIBDNS_API MX : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/naptr_35.h b/src/lib/dns/rdata/generic/naptr_35.h
index c82ef87..60c1c4d 100644
--- a/src/lib/dns/rdata/generic/naptr_35.h
+++ b/src/lib/dns/rdata/generic/naptr_35.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <util/buffer.h>
@@ -33,7 +34,7 @@
 /// This class implements the basic interfaces inherited from the
 /// \c rdata::Rdata class, and provides accessors specific to the
 /// NAPTR rdata.
-class NAPTR : public Rdata {
+class B10_LIBDNS_API NAPTR : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ns_2.h b/src/lib/dns/rdata/generic/ns_2.h
index fa44f22..0b9fd7c 100644
--- a/src/lib/dns/rdata/generic/ns_2.h
+++ b/src/lib/dns/rdata/generic/ns_2.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class NS : public Rdata {
+class B10_LIBDNS_API NS : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec3_50.h b/src/lib/dns/rdata/generic/nsec3_50.h
index c766ade..248d82f 100644
--- a/src/lib/dns/rdata/generic/nsec3_50.h
+++ b/src/lib/dns/rdata/generic/nsec3_50.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -33,7 +34,7 @@
 
 struct NSEC3Impl;
 
-class NSEC3 : public Rdata {
+class B10_LIBDNS_API NSEC3 : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec3param_51.h b/src/lib/dns/rdata/generic/nsec3param_51.h
index 130c759..8b6cd7b 100644
--- a/src/lib/dns/rdata/generic/nsec3param_51.h
+++ b/src/lib/dns/rdata/generic/nsec3param_51.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -33,7 +34,7 @@
 
 struct NSEC3PARAMImpl;
 
-class NSEC3PARAM : public Rdata {
+class B10_LIBDNS_API NSEC3PARAM : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/nsec_47.h b/src/lib/dns/rdata/generic/nsec_47.h
index 005dd3a..a4c434e 100644
--- a/src/lib/dns/rdata/generic/nsec_47.h
+++ b/src/lib/dns/rdata/generic/nsec_47.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct NSECImpl;
 
-class NSEC : public Rdata {
+class B10_LIBDNS_API NSEC : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/opt_41.h b/src/lib/dns/rdata/generic/opt_41.h
index 0cb7043..8881e3c 100644
--- a/src/lib/dns/rdata/generic/opt_41.h
+++ b/src/lib/dns/rdata/generic/opt_41.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class OPT : public Rdata {
+class B10_LIBDNS_API OPT : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/ptr_12.h b/src/lib/dns/rdata/generic/ptr_12.h
index 5d2d048..51a23f2 100644
--- a/src/lib/dns/rdata/generic/ptr_12.h
+++ b/src/lib/dns/rdata/generic/ptr_12.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -26,7 +27,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class PTR : public Rdata {
+class B10_LIBDNS_API PTR : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/rp_17.h b/src/lib/dns/rdata/generic/rp_17.h
index a90a530..db752a8 100644
--- a/src/lib/dns/rdata/generic/rp_17.h
+++ b/src/lib/dns/rdata/generic/rp_17.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// RP RDATA.
-class RP : public Rdata {
+class B10_LIBDNS_API RP : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/rrsig_46.h b/src/lib/dns/rdata/generic/rrsig_46.h
index b32c17f..675006b 100644
--- a/src/lib/dns/rdata/generic/rrsig_46.h
+++ b/src/lib/dns/rdata/generic/rrsig_46.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rrtype.h>
 #include <dns/rrttl.h>
@@ -32,7 +33,7 @@
 
 struct RRSIGImpl;
 
-class RRSIG : public Rdata {
+class B10_LIBDNS_API RRSIG : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/soa_6.h b/src/lib/dns/rdata/generic/soa_6.h
index 2c180b2..0206844 100644
--- a/src/lib/dns/rdata/generic/soa_6.h
+++ b/src/lib/dns/rdata/generic/soa_6.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 #include <dns/serial.h>
@@ -27,7 +28,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class SOA : public Rdata {
+class B10_LIBDNS_API SOA : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/spf_99.h b/src/lib/dns/rdata/generic/spf_99.h
index 04ac99b..c692b7d 100644
--- a/src/lib/dns/rdata/generic/spf_99.h
+++ b/src/lib/dns/rdata/generic/spf_99.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -36,7 +37,7 @@ template<class Type, uint16_t typeCode> class TXTLikeImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class. The semantics of the class is provided by
 /// a copy of instantiated TXTLikeImpl class common to both TXT and SPF.
-class SPF : public Rdata {
+class B10_LIBDNS_API SPF : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/sshfp_44.h b/src/lib/dns/rdata/generic/sshfp_44.h
index d9ebea4..8e52956 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.h
+++ b/src/lib/dns/rdata/generic/sshfp_44.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -28,7 +29,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class SSHFP : public Rdata {
+class B10_LIBDNS_API SSHFP : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/generic/txt_16.h b/src/lib/dns/rdata/generic/txt_16.h
index d99d69b..117f33b 100644
--- a/src/lib/dns/rdata/generic/txt_16.h
+++ b/src/lib/dns/rdata/generic/txt_16.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -30,7 +31,7 @@
 
 template<class Type, uint16_t typeCode> class TXTLikeImpl;
 
-class TXT : public Rdata {
+class B10_LIBDNS_API TXT : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/hs_4/a_1.h b/src/lib/dns/rdata/hs_4/a_1.h
index 6d75952..55ae81d 100644
--- a/src/lib/dns/rdata/hs_4/a_1.h
+++ b/src/lib/dns/rdata/hs_4/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class B10_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/a_1.h b/src/lib/dns/rdata/in_1/a_1.h
index 6e98f0d..cf8f437 100644
--- a/src/lib/dns/rdata/in_1/a_1.h
+++ b/src/lib/dns/rdata/in_1/a_1.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -25,7 +26,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class A : public Rdata {
+class B10_LIBDNS_API A : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/aaaa_28.h b/src/lib/dns/rdata/in_1/aaaa_28.h
index 3093017..91df916 100644
--- a/src/lib/dns/rdata/in_1/aaaa_28.h
+++ b/src/lib/dns/rdata/in_1/aaaa_28.h
@@ -18,6 +18,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -27,7 +28,7 @@
 
 // BEGIN_RDATA_NAMESPACE
 
-class AAAA : public Rdata {
+class B10_LIBDNS_API AAAA : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/dhcid_49.h b/src/lib/dns/rdata/in_1/dhcid_49.h
index 90f5fab..47f9df2 100644
--- a/src/lib/dns/rdata/in_1/dhcid_49.h
+++ b/src/lib/dns/rdata/in_1/dhcid_49.h
@@ -17,6 +17,7 @@
 #include <string>
 #include <vector>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -32,7 +33,7 @@
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// DHCID RDATA.
-class DHCID : public Rdata {
+class B10_LIBDNS_API DHCID : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/in_1/srv_33.h b/src/lib/dns/rdata/in_1/srv_33.h
index 32b7dc0..1a78cea 100644
--- a/src/lib/dns/rdata/in_1/srv_33.h
+++ b/src/lib/dns/rdata/in_1/srv_33.h
@@ -16,6 +16,7 @@
 
 #include <stdint.h>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdata.h>
 
@@ -34,7 +35,7 @@ struct SRVImpl;
 /// This class implements the basic interfaces inherited from the abstract
 /// \c rdata::Rdata class, and provides trivial accessors specific to the
 /// SRV RDATA.
-class SRV : public Rdata {
+class B10_LIBDNS_API SRV : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // END_COMMON_MEMBERS
diff --git a/src/lib/dns/rdata/template.h b/src/lib/dns/rdata/template.h
index 9e84cc3..f30d8ba 100644
--- a/src/lib/dns/rdata/template.h
+++ b/src/lib/dns/rdata/template.h
@@ -16,6 +16,7 @@
 
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 // BEGIN_ISC_NAMESPACE
@@ -40,7 +41,7 @@
 // These are markers used by a script for auto-generating build-able source
 // files.
 
-class MyType : public Rdata {
+class B10_LIBDNS_API MyType : public Rdata {
 public:
     // BEGIN_COMMON_MEMBERS
     // Do not remove the BEGIN_xxx and END_xxx comment lines.
diff --git a/src/lib/dns/rdatafields.cc b/src/lib/dns/rdatafields.cc
index 695c5e8..5f75739 100644
--- a/src/lib/dns/rdatafields.cc
+++ b/src/lib/dns/rdatafields.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <cassert>
diff --git a/src/lib/dns/rdatafields.h b/src/lib/dns/rdatafields.h
index 16880f0..6fdb95a 100644
--- a/src/lib/dns/rdatafields.h
+++ b/src/lib/dns/rdatafields.h
@@ -19,15 +19,18 @@
 
 #include <cstddef>
 
+#include <util/dll.h>
+#include <dns/dll.h>
+
 namespace isc {
 namespace util {
-class OutputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 namespace rdata {
-class Rdata;
+class B10_LIBDNS_API Rdata;
 
 /// A low-level, RR type-independent representation of DNS RDATA.
 ///
@@ -156,7 +159,7 @@ getFieldSpecData()-> { compressible name { compressible name { other data
 /// future version.  One possibility is to store offset information as well
 /// as the name data (at the cost of increasing memory footprint), and
 /// to use the pair of data for faster rendering.
-class RdataFields {
+class B10_LIBDNS_API RdataFields {
 public:
     /// Types of \c RdataFields fields.
     ///
diff --git a/src/lib/dns/rrclass-placeholder.h b/src/lib/dns/rrclass-placeholder.h
index 80035d8..3bd6cf6 100644
--- a/src/lib/dns/rrclass-placeholder.h
+++ b/src/lib/dns/rrclass-placeholder.h
@@ -21,23 +21,25 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRClass object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRClass : public Exception {
+class B10_LIBDNS_API InvalidRRClass : public Exception {
 public:
     InvalidRRClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -47,7 +49,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRClass object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRClass : public Exception {
+class B10_LIBDNS_API IncompleteRRClass : public Exception {
 public:
     IncompleteRRClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -87,7 +89,7 @@ public:
 /// the proxy function.
 ///
 /// Note to developers: same note as \c RRType applies.
-class RRClass {
+class B10_LIBDNS_API RRClass {
 public:
     ///
     /// \name Constructors and Destructor
@@ -279,7 +281,7 @@ RRClass::NONE() {
 /// \param rrclass The \c RRClass object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRClass& rrclass);
 }
 }
diff --git a/src/lib/dns/rrclass.cc b/src/lib/dns/rrclass.cc
index ac5823c..82e85a4 100644
--- a/src/lib/dns/rrclass.cc
+++ b/src/lib/dns/rrclass.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <string>
@@ -56,7 +58,7 @@ RRClass::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint16(classcode_);
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(ostream& os, const RRClass& rrclass) {
     os << rrclass.toText();
     return (os);
diff --git a/src/lib/dns/rrparamregistry-placeholder.cc b/src/lib/dns/rrparamregistry-placeholder.cc
index f7f3a1a..76ebeba 100644
--- a/src/lib/dns/rrparamregistry-placeholder.cc
+++ b/src/lib/dns/rrparamregistry-placeholder.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <cassert>
 #include <algorithm>
 #include <cctype>
diff --git a/src/lib/dns/rrparamregistry.h b/src/lib/dns/rrparamregistry.h
index ae41b5f..f50520c 100644
--- a/src/lib/dns/rrparamregistry.h
+++ b/src/lib/dns/rrparamregistry.h
@@ -23,6 +23,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 
 namespace isc {
@@ -35,7 +36,7 @@ struct RRParamRegistryImpl;
 /// \brief A standard DNS module exception that is thrown if a new RR type is
 /// being registered with a different type string.
 ///
-class RRTypeExists : public Exception {
+class B10_LIBDNS_API RRTypeExists : public Exception {
 public:
     RRTypeExists(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -45,7 +46,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if a new RR class is
 /// being registered with a different type string.
 ///
-class RRClassExists : public Exception {
+class B10_LIBDNS_API RRClassExists : public Exception {
 public:
     RRClassExists(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -62,7 +63,7 @@ namespace rdata {
 /// For other users of this API normally do not have to care about this class
 /// or its derived classes; this class is generally intended to be used
 /// as an internal utility of the API implementation.
-class AbstractRdataFactory {
+class B10_LIBDNS_API AbstractRdataFactory {
     ///
     /// \name Constructors and Destructor
     ///
@@ -166,7 +167,7 @@ typedef boost::shared_ptr<AbstractRdataFactory> RdataFactoryPtr;
 /// Note: the implementation of this class is incomplete: we should at least
 /// add RDATA related parameters.  This will be done in a near future version,
 /// at which point some of method signatures will be changed.
-class RRParamRegistry {
+class B10_LIBDNS_API RRParamRegistry {
     ///
     /// \name Constructors and Destructor
     ///
diff --git a/src/lib/dns/rrset.cc b/src/lib/dns/rrset.cc
index 2bdb71f..434a92b 100644
--- a/src/lib/dns/rrset.cc
+++ b/src/lib/dns/rrset.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <algorithm>
 #include <string>
 #include <vector>
@@ -147,7 +149,7 @@ AbstractRRset::isSameKind(const AbstractRRset& other) const {
           getClass() == other.getClass());
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(ostream& os, const AbstractRRset& rrset) {
     os << rrset.toText();
     return (os);
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index 2cf0110..764e0c7 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -20,16 +20,18 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <util/dll.h>
 #include <util/noncopyable.h>
 
 #include <exceptions/exceptions.h>
 
+#include <dns/dll.h>
 #include <dns/rdata.h>
 #include <dns/rrtype.h>
 
 namespace isc {
 namespace util {
-class OututBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
@@ -38,23 +40,23 @@ namespace dns {
 /// \brief A standard DNS module exception that is thrown if an RRset object
 /// does not contain any RDATA where required.
 ///
-class EmptyRRset : public Exception {
+class B10_LIBDNS_API EmptyRRset : public Exception {
 public:
     EmptyRRset(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
 };
 
 // forward declarations
-class Name;
-class RRType;
-class RRClass;
-class RRTTL;
-class AbstractMessageRenderer;
-class AbstractRRset;
-class BasicRRset;
-class RdataIterator;
+class B10_LIBDNS_API Name;
+class B10_LIBDNS_API RRType;
+class B10_LIBDNS_API RRClass;
+class B10_LIBDNS_API RRTTL;
+class B10_LIBDNS_API AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractRRset;
+class B10_LIBDNS_API BasicRRset;
+class B10_LIBDNS_API RdataIterator;
 class BasicRRsetImpl;
-class RRset;
+class B10_LIBDNS_API RRset;
 
 /// \brief A pointer-like type pointing to an \c RRset object.
 ///
@@ -161,7 +163,7 @@ typedef boost::shared_ptr<RdataIterator> RdataIteratorPtr;
 ///     monolithic.)
 ///   - Do we need to allow the user to remove specific Rdata?
 ///     Probably not, according to the current usage of the BIND9 code.
-class AbstractRRset : isc::util::noncopyable {
+class B10_LIBDNS_API AbstractRRset : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
@@ -529,7 +531,7 @@ public:
 /// Most applications will simply go through the RDATA objects contained in
 /// an RRset, examining (and possibly using) each object, as one path
 /// operation.
-class RdataIterator : isc::util::noncopyable {
+class B10_LIBDNS_API RdataIterator : isc::util::noncopyable {
     ///
     /// \name Constructors and Destructor
     ///
@@ -595,7 +597,7 @@ public:
 /// Highly performance-sensitive applications, such as a large scale
 /// authoritative or caching name servers will implement and use a customized
 /// version of derived \c AbstractRRset class.
-class BasicRRset : public AbstractRRset {
+class B10_LIBDNS_API BasicRRset : public AbstractRRset {
     ///
     /// \name Constructors and Destructor
     ///
@@ -806,7 +808,7 @@ private:
 /// containing associated RRSIG records.  This allows DNSSEC aware
 /// applications to treat data associated with a particular
 /// QNAME/QTYPE/QCLASS as a single object.
-class RRset : public BasicRRset {
+class B10_LIBDNS_API RRset : public BasicRRset {
 public:
     RRset(const Name& name, const RRClass& rrclass,
           const RRType& rrtype, const RRTTL& ttl);
@@ -900,7 +902,8 @@ private:
 /// output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const AbstractRRset& rrset);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const AbstractRRset& rrset);
 } // end of namespace dns
 } // end of namespace isc
 #endif  // __RRSET_H
diff --git a/src/lib/dns/rrsetlist.cc b/src/lib/dns/rrsetlist.cc
index fcdcfbb..6bc7ae2 100644
--- a/src/lib/dns/rrsetlist.cc
+++ b/src/lib/dns/rrsetlist.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <vector>
 
 #include <boost/foreach.hpp>
diff --git a/src/lib/dns/rrsetlist.h b/src/lib/dns/rrsetlist.h
index 4db3ff2..855404c 100644
--- a/src/lib/dns/rrsetlist.h
+++ b/src/lib/dns/rrsetlist.h
@@ -23,6 +23,7 @@
 
 #include <util/noncopyable.h>
 
+#include <dns/dll.h>
 #include <dns/rrset.h>
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
@@ -30,7 +31,7 @@
 namespace isc {
 namespace dns {
 
-class DuplicateRRset : public Exception {
+class B10_LIBDNS_API DuplicateRRset : public Exception {
 public:
     DuplicateRRset(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -96,7 +97,7 @@ private:
 /// reason and is actually quite specific to a particular need for libdatasrc.
 /// If you are tempted to use it, think twice to assess if this class
 /// is really what you want.  Again, in many cases the answer will be no.
-class RRsetList : isc::util::noncopyable {
+class B10_LIBDNS_API RRsetList : isc::util::noncopyable {
 public:
     RRsetList() {}
     void addRRset(RRsetPtr new_rrsetptr);
diff --git a/src/lib/dns/rrttl.cc b/src/lib/dns/rrttl.cc
index 49c63be..5791e21 100644
--- a/src/lib/dns/rrttl.cc
+++ b/src/lib/dns/rrttl.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <sstream>
@@ -67,7 +69,7 @@ RRTTL::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint32(ttlval_);
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(ostream& os, const RRTTL& rrttl) {
     os << rrttl.toText();
     return (os);
diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h
index bf23295..f70016a 100644
--- a/src/lib/dns/rrttl.h
+++ b/src/lib/dns/rrttl.h
@@ -18,23 +18,25 @@
 #include <stdint.h>
 
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRTTL object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRTTL : public Exception {
+class B10_LIBDNS_API InvalidRRTTL : public Exception {
 public:
     InvalidRRTTL(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -44,7 +46,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRTTL object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRTTL : public Exception {
+class B10_LIBDNS_API IncompleteRRTTL : public Exception {
 public:
     IncompleteRRTTL(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -58,7 +60,7 @@ public:
 /// of this class is to provide convenient interfaces to convert a textual
 /// representation into the integer TTL value and vice versa, and to handle
 /// wire-format representations.
-class RRTTL {
+class B10_LIBDNS_API RRTTL {
 public:
     ///
     /// \name Constructors and Destructor
@@ -251,7 +253,7 @@ private:
 /// \param rrttl The \c RRTTL object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRTTL& rrttl);
 }
 }
diff --git a/src/lib/dns/rrtype-placeholder.h b/src/lib/dns/rrtype-placeholder.h
index 95a84c6..bf6f5bf 100644
--- a/src/lib/dns/rrtype-placeholder.h
+++ b/src/lib/dns/rrtype-placeholder.h
@@ -21,6 +21,8 @@
 #include <ostream>
 
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
+#include <dns/dll.h>
 
 // Solaris x86 defines DS in <sys/regset.h>, which gets pulled in by Boost
 #if defined(__sun) && defined(DS)
@@ -29,20 +31,20 @@
 
 namespace isc {
 namespace util {
-class InputBuffer;
-class OutputBuffer;
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 
 namespace dns {
 
 // forward declarations
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 ///
 /// \brief A standard DNS module exception that is thrown if an RRType object
 /// is being constructed from an unrecognized string.
 ///
-class InvalidRRType : public Exception {
+class B10_LIBDNS_API InvalidRRType : public Exception {
 public:
     InvalidRRType(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -52,7 +54,7 @@ public:
 /// \brief A standard DNS module exception that is thrown if an RRType object
 /// is being constructed from a incomplete (too short) wire-format data.
 ///
-class IncompleteRRType : public Exception {
+class B10_LIBDNS_API IncompleteRRType : public Exception {
 public:
     IncompleteRRType(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -104,7 +106,7 @@ public:
 /// this assumption, but if we encounter memory bloat due to this problem with
 /// particular compilers we need to revisit the design or think about
 /// workaround.
-class RRType {
+class B10_LIBDNS_API RRType {
 public:
     ///
     /// \name Constructors and Destructor
@@ -313,7 +315,7 @@ RRType::ANY() {
 /// \param rrtype The \c RRType object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const RRType& rrtype);
 }
 }
diff --git a/src/lib/dns/rrtype.cc b/src/lib/dns/rrtype.cc
index 4ef4e67..016c188 100644
--- a/src/lib/dns/rrtype.cc
+++ b/src/lib/dns/rrtype.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <stdint.h>
 
 #include <string>
@@ -57,7 +59,7 @@ RRType::toWire(AbstractMessageRenderer& renderer) const {
     renderer.writeUint16(typecode_);
 }
 
-ostream&
+B10_LIBDNS_API ostream&
 operator<<(ostream& os, const RRType& rrtype) {
     os << rrtype.toText();
     return (os);
diff --git a/src/lib/dns/serial.cc b/src/lib/dns/serial.cc
index 90bc242..5e5ed16 100644
--- a/src/lib/dns/serial.cc
+++ b/src/lib/dns/serial.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <dns/serial.h>
 
 namespace isc {
@@ -66,7 +68,7 @@ Serial::operator+(const Serial& other) const {
     return (operator+(other.getValue()));
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const Serial& serial) {
     return (os << serial.getValue());
 }
diff --git a/src/lib/dns/serial.h b/src/lib/dns/serial.h
index 3549860..b5c9b77 100644
--- a/src/lib/dns/serial.h
+++ b/src/lib/dns/serial.h
@@ -18,6 +18,8 @@
 #include <stdint.h>
 #include <iostream>
 
+#include <dns/dll.h>
+
 namespace isc {
 namespace dns {
 
@@ -46,7 +48,7 @@ const uint64_t MAX_SERIAL_VALUE = 4294967296ull;
 /// \note RFC 1982 defines everything based on the value SERIAL_BITS. Since
 /// the serial number has a fixed length of 32 bits, the values we use are
 /// hard-coded, and not computed based on variable bit lengths.
-class Serial {
+class B10_LIBDNS_API Serial {
 public:
     /// \brief Constructor with value
     ///
@@ -147,7 +149,8 @@ private:
 /// \param os The ostream to write to
 /// \param serial The Serial to write
 /// \return the output stream
-std::ostream& operator<<(std::ostream& os, const Serial& serial);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const Serial& serial);
 
 } // end namespace dns
 } // end namespace isc
diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc
index 8bf3acc..d304c5f 100644
--- a/src/lib/dns/tests/message_unittest.cc
+++ b/src/lib/dns/tests/message_unittest.cc
@@ -66,7 +66,7 @@ const uint16_t Message::DEFAULT_MAX_UDPSIZE;
 namespace isc {
 namespace util {
 namespace detail {
-extern int64_t (*gettimeFunction)();
+extern B10_LIBUTIL_API int64_t (*gettimeFunction)();
 }
 }
 }
diff --git a/src/lib/dns/tests/tsig_unittest.cc b/src/lib/dns/tests/tsig_unittest.cc
index ac503e5..2c1419b 100644
--- a/src/lib/dns/tests/tsig_unittest.cc
+++ b/src/lib/dns/tests/tsig_unittest.cc
@@ -53,7 +53,7 @@ using isc::UnitTestUtil;
 namespace isc {
 namespace util {
 namespace detail {
-extern int64_t (*gettimeFunction)();
+extern B10_LIBUTIL_API int64_t (*gettimeFunction)();
 }
 }
 }
diff --git a/src/lib/dns/tsig.cc b/src/lib/dns/tsig.cc
index fb9a48d..344b4ea 100644
--- a/src/lib/dns/tsig.cc
+++ b/src/lib/dns/tsig.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <sys/time.h>
 
 #include <stdint.h>
diff --git a/src/lib/dns/tsig.h b/src/lib/dns/tsig.h
index 73e7fda..b4a63c8 100644
--- a/src/lib/dns/tsig.h
+++ b/src/lib/dns/tsig.h
@@ -18,6 +18,7 @@
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
 
+#include <dns/dll.h>
 #include <dns/tsigerror.h>
 #include <dns/tsigkey.h>
 #include <dns/tsigrecord.h>
@@ -31,7 +32,7 @@ namespace dns {
 /// Note that this exception is not thrown for TSIG protocol errors such as
 /// verification failures.  In general, this exception indicates an internal
 /// program bug.
-class TSIGContextError : public isc::Exception {
+class B10_LIBDNS_API TSIGContextError : public isc::Exception {
 public:
     TSIGContextError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -171,7 +172,7 @@ public:
 /// direct or indirect dependencies.  The interface of \c sign() that takes
 /// opaque data (instead of, e.g., a \c Message or \c MessageRenderer object)
 /// is therefore a deliberate design decision.
-class TSIGContext : isc::util::noncopyable {
+class B10_LIBDNS_API TSIGContext : isc::util::noncopyable {
 public:
     /// Internal state of context
     ///
diff --git a/src/lib/dns/tsigerror.cc b/src/lib/dns/tsigerror.cc
index 36ef47d..367e589 100644
--- a/src/lib/dns/tsigerror.cc
+++ b/src/lib/dns/tsigerror.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <ostream>
 #include <string>
 
@@ -60,7 +62,7 @@ TSIGError::toRcode() const {
     return (Rcode::NOTAUTH());
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const TSIGError& error) {
     return (os << error.toText());
 }
diff --git a/src/lib/dns/tsigerror.h b/src/lib/dns/tsigerror.h
index 8efd3ae..a2564e9 100644
--- a/src/lib/dns/tsigerror.h
+++ b/src/lib/dns/tsigerror.h
@@ -18,6 +18,7 @@
 #include <ostream>
 #include <string>
 
+#include <dns/dll.h>
 #include <dns/rcode.h>
 
 namespace isc {
@@ -27,7 +28,7 @@ namespace dns {
 /// The \c TSIGError class objects represent standard errors related to
 /// TSIG protocol operations as defined in related specifications, mainly
 /// in RFC2845.
-class TSIGError {
+class B10_LIBDNS_API TSIGError {
 public:
     /// Constants for pre-defined TSIG error values.
     ///
@@ -327,7 +328,8 @@ TSIGError::BAD_TIME() {
 /// \param tsig_error An \c TSIGError object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const TSIGError& tsig_error);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const TSIGError& tsig_error);
 }
 }
 
diff --git a/src/lib/dns/tsigkey.cc b/src/lib/dns/tsigkey.cc
index 96608aa..9b1f86a 100644
--- a/src/lib/dns/tsigkey.cc
+++ b/src/lib/dns/tsigkey.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <map>
 #include <utility>
 #include <vector>
diff --git a/src/lib/dns/tsigkey.h b/src/lib/dns/tsigkey.h
index 334330c..08f41f2 100644
--- a/src/lib/dns/tsigkey.h
+++ b/src/lib/dns/tsigkey.h
@@ -17,11 +17,12 @@
 
 #include <util/nonassignable.h>
 #include <cryptolink/cryptolink.h>
+#include <dns/dll.h>
 
 namespace isc {
 namespace dns {
 
-class Name;
+class B10_LIBDNS_API Name;
 
 /// \brief TSIG key.
 ///
@@ -61,7 +62,7 @@ class Name;
 /// remember the actual domain names defined in the protocol specification.
 /// We may also have to add conversion routines between domain names
 /// and more intuitive representations (e.g. strings) for algorithms.
-class TSIGKey {
+class B10_LIBDNS_API TSIGKey {
 public:
     ///
     /// \name Constructors, Assignment Operator and Destructor.
@@ -235,7 +236,7 @@ private:
 /// in different DNS transactions).
 /// If this assumption does not hold and memory consumption becomes an issue
 /// we may have to revisit the design.
-class TSIGKeyRing {
+class B10_LIBDNS_API TSIGKeyRing {
 public:
     /// Result codes of various public methods of \c TSIGKeyRing
     enum Result {
diff --git a/src/lib/dns/tsigrecord.cc b/src/lib/dns/tsigrecord.cc
index 9dd3f78..b534e98 100644
--- a/src/lib/dns/tsigrecord.cc
+++ b/src/lib/dns/tsigrecord.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBDNS_EXPORT
+
 #include <ostream>
 #include <string>
 
@@ -139,7 +141,7 @@ TSIGRecord::toText() const {
             rdata_.toText() + "\n");
 }
 
-std::ostream&
+B10_LIBDNS_API std::ostream&
 operator<<(std::ostream& os, const TSIGRecord& record) {
     return (os << record.toText());
 }
diff --git a/src/lib/dns/tsigrecord.h b/src/lib/dns/tsigrecord.h
index 5fb3fa1..f9d474e 100644
--- a/src/lib/dns/tsigrecord.h
+++ b/src/lib/dns/tsigrecord.h
@@ -23,15 +23,16 @@
 #include <util/buffer.h>
 #include <util/nonassignable.h>
 
+#include <dns/dll.h>
 #include <dns/name.h>
 #include <dns/rdataclass.h>
 
 namespace isc {
 namespace util {
-class OutputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
 }
 namespace dns {
-class AbstractMessageRenderer;
+class B10_LIBDNS_API AbstractMessageRenderer;
 
 /// TSIG resource record.
 ///
@@ -60,7 +61,7 @@ class AbstractMessageRenderer;
 /// handle it through a generic interface in a polymorphic way.
 /// We therefore chose to define it as a separate class.  This is also
 /// similar to why \c EDNS is a separate class.
-class TSIGRecord : isc::util::nonassignable {
+class B10_LIBDNS_API TSIGRecord : isc::util::nonassignable {
 public:
     ///
     /// \name Constructors
@@ -298,7 +299,8 @@ typedef boost::shared_ptr<const TSIGRecord> ConstTSIGRecordPtr;
 /// \param record A \c TSIGRecord object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const TSIGRecord& record);
+B10_LIBDNS_API std::ostream&
+operator<<(std::ostream& os, const TSIGRecord& record);
 }
 }
 
diff --git a/src/lib/exceptions/Makefile.am b/src/lib/exceptions/Makefile.am
index aa7d6cd..637b10b 100644
--- a/src/lib/exceptions/Makefile.am
+++ b/src/lib/exceptions/Makefile.am
@@ -4,9 +4,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CXXFLAGS=$(B10_CXXFLAGS)
 
 lib_LTLIBRARIES = libb10-exceptions.la
-libb10_exceptions_la_SOURCES = exceptions.h exceptions.cc
+libb10_exceptions_la_SOURCES = dll.h exceptions.h exceptions.cc
 
 CLEANFILES = *.gcno *.gcda
 
 libb10_exceptions_includedir = $(includedir)/$(PACKAGE_NAME)/exceptions
-libb10_exceptions_include_HEADERS = exceptions.h
+libb10_exceptions_include_HEADERS = dll.h exceptions.h
diff --git a/src/lib/exceptions/dll.h b/src/lib/exceptions/dll.h
new file mode 100644
index 0000000..be6ee83
--- /dev/null
+++ b/src/lib/exceptions/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBEXCEPTIONS_H
+#define __LIBEXCEPTIONS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBEXCEPTIONS_API
+#else
+#ifdef B10_LIBEXCEPTIONS_EXPORT
+#define B10_LIBEXCEPTIONS_API __declspec(dllexport)
+#else
+#define B10_LIBEXCEPTIONS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBEXCEPTIONS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/exceptions/exceptions.cc b/src/lib/exceptions/exceptions.cc
index 2a374da..7bfc507 100644
--- a/src/lib/exceptions/exceptions.cc
+++ b/src/lib/exceptions/exceptions.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBEXCEPTIONS_EXPORT
+
 #include <string>
 
 #include <exceptions/exceptions.h>
diff --git a/src/lib/exceptions/exceptions.h b/src/lib/exceptions/exceptions.h
index 3d25869..2b9b8b0 100644
--- a/src/lib/exceptions/exceptions.h
+++ b/src/lib/exceptions/exceptions.h
@@ -20,6 +20,7 @@
 #include <sstream>
 
 #include <util/nonassignable.h>
+#include <exceptions/dll.h>
 
 namespace isc {
 
@@ -30,7 +31,8 @@ namespace isc {
 /// exception such as the file name and line number where the exception is
 /// triggered.
 ///
-class Exception : isc::util::nonassignable, public std::exception {
+class B10_LIBEXCEPTIONS_API Exception :
+    isc::util::nonassignable, public std::exception {
 public:
     ///
     /// \name Constructors and Destructor
@@ -100,7 +102,7 @@ private:
 
 /// \brief A generic exception that is thrown if a parameter given
 /// to a method would refer to or modify out-of-range data.
-class OutOfRange : public Exception {
+class B10_LIBEXCEPTIONS_API OutOfRange : public Exception {
 public:
     OutOfRange(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -109,7 +111,7 @@ public:
 /// \brief A generic exception that is thrown if a parameter given
 /// to a method or function is considered invalid and no other specific
 /// exceptions are suitable to describe the error.
-class InvalidParameter : public Exception {
+class B10_LIBEXCEPTIONS_API InvalidParameter : public Exception {
 public:
     InvalidParameter(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -117,7 +119,7 @@ public:
 
 /// \brief A generic exception that is thrown if a parameter given
 /// to a method is considered invalid in that context.
-class BadValue : public Exception {
+class B10_LIBEXCEPTIONS_API BadValue : public Exception {
 public:
     BadValue(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -128,7 +130,7 @@ public:
 ///
 /// For example, this can happen if a class method is called when the object's
 /// state does not allow that particular method.
-class InvalidOperation : public Exception {
+class B10_LIBEXCEPTIONS_API InvalidOperation : public Exception {
 public:
     InvalidOperation(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -138,7 +140,7 @@ public:
 /// \brief A generic exception that is thrown when an unexpected
 /// error condition occurs.
 ///
-class Unexpected : public Exception {
+class B10_LIBEXCEPTIONS_API Unexpected : public Exception {
 public:
     Unexpected(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -150,7 +152,7 @@ public:
 ///
 /// This may be due to unfinished implementation or in case the
 /// function isn't even planned to be provided for that situation.
-class NotImplemented : public Exception {
+class B10_LIBEXCEPTIONS_API NotImplemented : public Exception {
 public:
     NotImplemented(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
diff --git a/src/lib/log/Makefile.am b/src/lib/log/Makefile.am
index 6207655..6ad3d2e 100644
--- a/src/lib/log/Makefile.am
+++ b/src/lib/log/Makefile.am
@@ -7,7 +7,7 @@ AM_CPPFLAGS += -DTOP_BUILDDIR=\"${abs_top_builddir}\"
 CLEANFILES = *.gcno *.gcda
 
 lib_LTLIBRARIES = libb10-log.la
-libb10_log_la_SOURCES  =
+libb10_log_la_SOURCES  = dll.h
 libb10_log_la_SOURCES += dummylog.h dummylog.cc
 libb10_log_la_SOURCES += logimpl_messages.cc logimpl_messages.h
 libb10_log_la_SOURCES += log_dbglevels.h
diff --git a/src/lib/log/dll.h b/src/lib/log/dll.h
new file mode 100644
index 0000000..512c339
--- /dev/null
+++ b/src/lib/log/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBLOG_H
+#define __LIBLOG_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBLOG_API
+#else
+#ifdef B10_LIBLOG_EXPORT
+#define B10_LIBLOG_API __declspec(dllexport)
+#else
+#define B10_LIBLOG_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBLOG_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/log/dummylog.cc b/src/lib/log/dummylog.cc
index 5f025e1..5f19763 100644
--- a/src/lib/log/dummylog.cc
+++ b/src/lib/log/dummylog.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include "dummylog.h"
 
 #include <iostream>
@@ -21,10 +23,10 @@ using namespace std;
 namespace isc {
 namespace log {
 
-bool denabled = false;
-string dprefix;
+B10_LIBLOG_API bool denabled = false;
+B10_LIBLOG_API string dprefix;
 
-void dlog(const string& message,bool error_flag) {
+B10_LIBLOG_API void dlog(const string& message,bool error_flag) {
     if (denabled || error_flag) {
         if (!dprefix.empty()) {
             cerr << "[" << dprefix << "] ";
diff --git a/src/lib/log/dummylog.h b/src/lib/log/dummylog.h
index ef5af13..76632c8 100644
--- a/src/lib/log/dummylog.h
+++ b/src/lib/log/dummylog.h
@@ -17,18 +17,20 @@
 
 #include <string>
 
+#include <log/dll.h>
+
 namespace isc {
 namespace log {
 
 /// Are we doing logging?
-extern bool denabled;
+extern B10_LIBLOG_API bool denabled;
 /**
  * \short Prefix into logs.
  *
  * The prefix is printed in front of every log message in square brackets.
  * The usual convention is to put the name of program here.
  */
-extern std::string dprefix;
+extern B10_LIBLOG_API std::string dprefix;
 
 /**
  * \short Temporary interface to logging.
@@ -53,7 +55,7 @@ extern std::string dprefix;
  *     more parameters.
  * \param error_flag TODO
  */
-void dlog(const std::string& message, bool error_flag=false);
+B10_LIBLOG_API void dlog(const std::string& message, bool error_flag=false);
 
 }
 }
diff --git a/src/lib/log/log_dbglevels.h b/src/lib/log/log_dbglevels.h
index d713714..b81f144 100644
--- a/src/lib/log/log_dbglevels.h
+++ b/src/lib/log/log_dbglevels.h
@@ -15,6 +15,8 @@
 #ifndef __LOG_DBGLVLS_H
 #define __LOG_DBGLVLS_H
 
+#include <log/dll.h>
+
 /// \file
 ///
 /// When a message is logged with DEBUG severity, the debug level associated
diff --git a/src/lib/log/log_formatter.cc b/src/lib/log/log_formatter.cc
index 9cd5cc7..caa5e82 100644
--- a/src/lib/log/log_formatter.cc
+++ b/src/lib/log/log_formatter.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include "config.h"
 #include <log/log_formatter.h>
 
@@ -27,7 +29,7 @@ using namespace boost;
 namespace isc {
 namespace log {
 
-void
+B10_LIBLOG_API void
 replacePlaceholder(string* message, const string& arg,
                    const unsigned placeholder)
 {
@@ -53,7 +55,7 @@ replacePlaceholder(string* message, const string& arg,
 #endif /* ENABLE_LOGGER_CHECKS */
 }
 
-void
+B10_LIBLOG_API void
 checkExcessPlaceholders(string* message, unsigned int placeholder) {
     const string mark("%" + lexical_cast<string>(placeholder));
     const size_t pos(message->find(mark));
diff --git a/src/lib/log/log_formatter.h b/src/lib/log/log_formatter.h
index eebdb1a..31bb6f2 100644
--- a/src/lib/log/log_formatter.h
+++ b/src/lib/log/log_formatter.h
@@ -21,6 +21,7 @@
 
 #include <exceptions/exceptions.h>
 #include <boost/lexical_cast.hpp>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 namespace isc {
@@ -31,7 +32,7 @@ namespace log {
 /// This exception is used to wrap a bad_lexical_cast exception thrown during
 /// formatting an argument.
 
-class FormatFailure : public isc::Exception {
+class B10_LIBLOG_API FormatFailure : public isc::Exception {
 public:
     FormatFailure(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -44,7 +45,7 @@ public:
 /// This exception is used when the number of placeholders do not match
 /// the number of arguments passed to the formatter.
 
-class MismatchedPlaceholders : public isc::Exception {
+class B10_LIBLOG_API MismatchedPlaceholders : public isc::Exception {
 public:
     MismatchedPlaceholders(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -57,7 +58,7 @@ public:
 ///
 /// This is used internally by the Formatter to check for excess
 /// placeholders (and fewer arguments).
-void
+B10_LIBLOG_API void
 checkExcessPlaceholders(std::string* message, unsigned int placeholder);
 
 ///
@@ -66,7 +67,7 @@ checkExcessPlaceholders(std::string* message, unsigned int placeholder);
 /// This is used internally by the Formatter. Replaces a placeholder
 /// in the message by replacement. If the placeholder is not found,
 /// it adds a complain at the end.
-void
+B10_LIBLOG_API void
 replacePlaceholder(std::string* message, const std::string& replacement,
                    const unsigned placeholder);
 
diff --git a/src/lib/log/logger.cc b/src/lib/log/logger.cc
index fef5627..505e3b5 100644
--- a/src/lib/log/logger.cc
+++ b/src/lib/log/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE
 
+#define B10_LIBLOG_EXPORT
+
 #include <stdarg.h>
 #include <stdio.h>
 
diff --git a/src/lib/log/logger.h b/src/lib/log/logger.h
index 85c407b..ee16bfd 100644
--- a/src/lib/log/logger.h
+++ b/src/lib/log/logger.h
@@ -22,6 +22,7 @@
 
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 #include <log/message_types.h>
 #include <log/log_formatter.h>
@@ -93,7 +94,7 @@ class LoggerImpl;   // Forward declaration of the implementation class
 ///
 /// Exception thrown if an attempt is made to access a logging function
 /// if the logging system has not been initialized.
-class LoggingNotInitialized : public isc::Exception {
+class B10_LIBLOG_API LoggingNotInitialized : public isc::Exception {
 public:
     LoggingNotInitialized(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -104,7 +105,7 @@ public:
 ///
 /// Exception thrown if a bad InterprocessSync object (such as NULL) is
 /// used.
-class BadInterprocessSync : public isc::Exception {
+class B10_LIBLOG_API BadInterprocessSync : public isc::Exception {
 public:
     BadInterprocessSync(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -123,7 +124,7 @@ public:
 /// These will avoid the potentially-expensive evaluation of arguments if the
 /// severity is such that the message will be suppressed.)
 
-class Logger : isc::util::noncopyable {
+class B10_LIBLOG_API Logger : isc::util::noncopyable {
 public:
     /// Maximum size of a logger name
     static const size_t MAX_LOGGER_NAME_SIZE = 31;
diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc
index 6cd3da5..0a56bd5 100644
--- a/src/lib/log/logger_impl.cc
+++ b/src/lib/log/logger_impl.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE
 
+#define B10_LIBLOG_EXPORT
+
 #include <iostream>
 #include <iomanip>
 #include <algorithm>
diff --git a/src/lib/log/logger_impl.h b/src/lib/log/logger_impl.h
index 10d3db4..4c14ce2 100644
--- a/src/lib/log/logger_impl.h
+++ b/src/lib/log/logger_impl.h
@@ -29,6 +29,7 @@
 #include <log4cplus/logger.h>
 
 // BIND-10 logger files
+#include <log/dll.h>
 #include <log/logger_level_impl.h>
 #include <log/message_types.h>
 
diff --git a/src/lib/log/logger_level.cc b/src/lib/log/logger_level.cc
index abac5be..7b6b286 100644
--- a/src/lib/log/logger_level.cc
+++ b/src/lib/log/logger_level.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE
 
+#define B10_LIBLOG_EXPORT
+
 #include <log/logger_level.h>
 #include <log/macros.h>
 #include <log/log_messages.h>
@@ -22,7 +24,7 @@
 namespace isc {
 namespace log {
 
-isc::log::Severity
+B10_LIBLOG_API isc::log::Severity
 getSeverity(const std::string& sev_str) {
     if (boost::iequals(sev_str, "DEBUG")) {
         return isc::log::DEBUG;
diff --git a/src/lib/log/logger_level.h b/src/lib/log/logger_level.h
index ea60c3c..1935c76 100644
--- a/src/lib/log/logger_level.h
+++ b/src/lib/log/logger_level.h
@@ -17,6 +17,8 @@
 
 #include <string>
 
+#include <log/dll.h>
+
 namespace isc {
 namespace log {
 
@@ -68,7 +70,7 @@ struct Level {
 ///
 /// \return The severity. If the string is not recognized, an error will be
 ///         logged and the string will return  isc::log::INFO.
-isc::log::Severity getSeverity(const std::string& sev_str);
+B10_LIBLOG_API isc::log::Severity getSeverity(const std::string& sev_str);
 
 }   // namespace log
 }   // namespace isc
diff --git a/src/lib/log/logger_level_impl.cc b/src/lib/log/logger_level_impl.cc
index bfc4748..c0b3432 100644
--- a/src/lib/log/logger_level_impl.cc
+++ b/src/lib/log/logger_level_impl.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <algorithm>
 #include <string.h>
 #include <iostream>
diff --git a/src/lib/log/logger_level_impl.h b/src/lib/log/logger_level_impl.h
index 17b866d..d74935a 100644
--- a/src/lib/log/logger_level_impl.h
+++ b/src/lib/log/logger_level_impl.h
@@ -17,6 +17,7 @@
 
 #include <log4cplus/logger.h>
 #include <log4cplus/version.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 namespace isc {
@@ -63,7 +64,7 @@ namespace log {
 /// of logging levels between log4cplus and BIND 10, and to register those
 /// levels with log4cplus.
 
-class LoggerLevelImpl {
+class B10_LIBLOG_API LoggerLevelImpl {
 public:
 
 #if (LOG4CPLUS_VERSION >= LOG4CPLUS_MAKE_VERSION(1, 1, 0))
diff --git a/src/lib/log/logger_manager.cc b/src/lib/log/logger_manager.cc
index 8431c2e..a902bdc 100644
--- a/src/lib/log/logger_manager.cc
+++ b/src/lib/log/logger_manager.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <algorithm>
 #include <vector>
 
diff --git a/src/lib/log/logger_manager.h b/src/lib/log/logger_manager.h
index dece0c9..53e1484 100644
--- a/src/lib/log/logger_manager.h
+++ b/src/lib/log/logger_manager.h
@@ -16,11 +16,12 @@
 #define __LOGGER_MANAGER_H
 
 #include "exceptions/exceptions.h"
+#include <log/dll.h>
 #include <log/logger_specification.h>
 
 // Generated if, when updating the logging specification, an unknown
 // destination is encountered.
-class UnknownLoggingDestination : public isc::Exception {
+class B10_LIBLOG_API UnknownLoggingDestination : public isc::Exception {
 public:
     UnknownLoggingDestination(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -40,7 +41,7 @@ class LoggerManagerImpl;
 /// To isolate the underlying implementation from basic processing, the
 /// LoggerManager is implemented using the "pimpl" idiom.
 
-class LoggerManager {
+class B10_LIBLOG_API LoggerManager {
 public:
     /// \brief Constructor
     LoggerManager();
diff --git a/src/lib/log/logger_manager_impl.cc b/src/lib/log/logger_manager_impl.cc
index 1af40c1..b5da8d2 100644
--- a/src/lib/log/logger_manager_impl.cc
+++ b/src/lib/log/logger_manager_impl.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <algorithm>
 #include <iostream>
 
diff --git a/src/lib/log/logger_manager_impl.h b/src/lib/log/logger_manager_impl.h
index 42a98f1..f5c6774 100644
--- a/src/lib/log/logger_manager_impl.h
+++ b/src/lib/log/logger_manager_impl.h
@@ -18,6 +18,7 @@
 #include <string>
 
 #include <log4cplus/appender.h>
+#include <log/dll.h>
 #include <log/logger_level.h>
 
 // Forward declaration to avoid need to include log4cplus header file here.
@@ -30,8 +31,8 @@ namespace isc {
 namespace log {
 
 // Forward declarations
-class LoggerSpecification;
-struct OutputOption;
+class B10_LIBLOG_API LoggerSpecification;
+struct B10_LIBLOG_API OutputOption;
 
 /// \brief Logger Manager Implementation
 ///
diff --git a/src/lib/log/logger_name.cc b/src/lib/log/logger_name.cc
index abfcd5e..72be0c0 100644
--- a/src/lib/log/logger_name.cc
+++ b/src/lib/log/logger_name.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <string>
 #include "log/logger_name.h"
 
@@ -31,16 +33,16 @@ getRootLoggerNameInternal() {
 
 } // Anonymous namespace
 
-void
+B10_LIBLOG_API void
 setRootLoggerName(const std::string& name) {
     getRootLoggerNameInternal() = name;
 }
 
-const std::string& getRootLoggerName() {
+B10_LIBLOG_API const std::string& getRootLoggerName() {
     return (getRootLoggerNameInternal());
 }
 
-std::string expandLoggerName(const std::string& name) {
+B10_LIBLOG_API std::string expandLoggerName(const std::string& name) {
 
     // Are we the root logger, or does the logger name start with
     // the string "<root_logger_name>.".  If so, use a logger
diff --git a/src/lib/log/logger_name.h b/src/lib/log/logger_name.h
index 82ea2ad..5774eed 100644
--- a/src/lib/log/logger_name.h
+++ b/src/lib/log/logger_name.h
@@ -17,6 +17,8 @@
 
 #include <string>
 
+#include <log/dll.h>
+
 /// \brief Define Name of Root Logger
 ///
 /// In BIND-10, the name root logger of a program is the name of the program
@@ -33,12 +35,12 @@ namespace log {
 /// any logging functions are called.
 ///
 /// \param name Name of the root logger.  This should be the program name.
-void setRootLoggerName(const std::string& name);
+B10_LIBLOG_API void setRootLoggerName(const std::string& name);
 
 /// \brief Get root logger name
 ///
 /// \return Name of the root logger.
-const std::string& getRootLoggerName();
+B10_LIBLOG_API const std::string& getRootLoggerName();
 
 /// \brief Expand logger name
 ///
@@ -49,7 +51,7 @@ const std::string& getRootLoggerName();
 /// \param name Name to expand.
 ///
 /// \return Fully-expanded logger name.
-std::string expandLoggerName(const std::string& name);
+B10_LIBLOG_API std::string expandLoggerName(const std::string& name);
 
 }
 }
diff --git a/src/lib/log/logger_specification.h b/src/lib/log/logger_specification.h
index 78df054..0128128 100644
--- a/src/lib/log/logger_specification.h
+++ b/src/lib/log/logger_specification.h
@@ -18,6 +18,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+#include <log/dll.h>
 #include <log/logger_level.h>
 #include <log/output_option.h>
 
@@ -34,7 +35,7 @@
 namespace isc {
 namespace log {
 
-class LoggerSpecification {
+class B10_LIBLOG_API LoggerSpecification {
 public:
     typedef std::vector<OutputOption>::iterator         iterator;
     typedef std::vector<OutputOption>::const_iterator   const_iterator;
diff --git a/src/lib/log/logger_support.cc b/src/lib/log/logger_support.cc
index 2097136..43b6232 100644
--- a/src/lib/log/logger_support.cc
+++ b/src/lib/log/logger_support.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE
 
+#define B10_LIBLOG_EXPORT
+
 #include <string>
 #include <log/logger_support.h>
 #include <log/logger_manager.h>
@@ -29,7 +31,7 @@ namespace isc {
 namespace log {
 
 // Return initialization state.
-bool
+B10_LIBLOG_API bool
 isLoggingInitialized() {
     return (logging_init_state);
 }
@@ -37,14 +39,14 @@ isLoggingInitialized() {
 // Set initialization state.  (Note: as logging can be initialized via a direct
 // call to LoggerManager::init(), this function is called from there, not from
 // the initialization functions in this file.
-void
+B10_LIBLOG_API void
 setLoggingInitialized(bool state) {
     logging_init_state = state;
 }
 
 // Logger Run-Time Initialization.
 
-void
+B10_LIBLOG_API void
 initLogger(const string& root, isc::log::Severity severity, int dbglevel,
     const char* file) {
     LoggerManager::init(root, severity, dbglevel, file);
diff --git a/src/lib/log/logger_support.h b/src/lib/log/logger_support.h
index 4ce3ced..c642170 100644
--- a/src/lib/log/logger_support.h
+++ b/src/lib/log/logger_support.h
@@ -18,6 +18,7 @@
 #include <unistd.h>
 
 #include <string>
+#include <log/dll.h>
 #include <log/logger.h>
 #include <log/logger_unittest_support.h>
 
@@ -38,13 +39,13 @@ namespace log {
 /// and throw an exception if logging is not initialized at that point.
 ///
 /// \return true if logging has been initialized, false if not
-bool isLoggingInitialized();
+B10_LIBLOG_API bool isLoggingInitialized();
 
 /// \brief Set state of "logging initialized" flag
 ///
 /// \param state State to set the flag to. (This is expected to be "true" - the
 ///        default - for all code apart from specific unit tests.)
-void setLoggingInitialized(bool state = true);
+B10_LIBLOG_API void setLoggingInitialized(bool state = true);
 
 /// \brief Run-time initialization
 ///
@@ -61,6 +62,7 @@ void setLoggingInitialized(bool state = true);
 /// \param severity Severity at which to log
 /// \param dbglevel Debug severity (ignored if "severity" is not "DEBUG")
 /// \param file Name of the local message file.
+B10_LIBLOG_API
 void initLogger(const std::string& root,
                 isc::log::Severity severity = isc::log::INFO,
                 int dbglevel = 0, const char* file = NULL);
diff --git a/src/lib/log/logger_unittest_support.cc b/src/lib/log/logger_unittest_support.cc
index 4f02b07..7912684 100644
--- a/src/lib/log/logger_unittest_support.cc
+++ b/src/lib/log/logger_unittest_support.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <iostream>
 #include <algorithm>
 #include <string>
@@ -34,7 +36,7 @@ namespace log {
 // of "FATAL".  (Note that the string must be in upper case with no leading
 // of trailing blanks.)  If not present, the default severity passed to the
 // function is returned.
-isc::log::Severity
+B10_LIBLOG_API isc::log::Severity
 b10LoggerSeverity(isc::log::Severity defseverity) {
     const char* sev_char = getenv("B10_LOGGER_SEVERITY");
     if (sev_char) {
@@ -46,7 +48,7 @@ b10LoggerSeverity(isc::log::Severity defseverity) {
 // Get the debug level.  This is defined by the envornment variable
 // B10_LOGGER_DBGLEVEL.  If not defined, a default value passed to the function
 // is returned.
-int
+B10_LIBLOG_API int
 b10LoggerDbglevel(int defdbglevel) {
     const char* dbg_char = getenv("B10_LOGGER_DBGLEVEL");
     if (dbg_char) {
@@ -79,7 +81,7 @@ b10LoggerDbglevel(int defdbglevel) {
 // Reset characteristics of the root logger to that set by the environment
 // variables B10_LOGGER_SEVERITY, B10_LOGGER_DBGLEVEL and B10_LOGGER_DESTINATION.
 
-void
+B10_LIBLOG_API void
 resetUnitTestRootLogger() {
 
     using namespace isc::log;
@@ -147,7 +149,7 @@ resetUnitTestRootLogger() {
 
 
 // Logger Run-Time Initialization via Environment Variables
-void initLogger(isc::log::Severity severity, int dbglevel) {
+B10_LIBLOG_API void initLogger(isc::log::Severity severity, int dbglevel) {
 
     // Root logger name is defined by the environment variable B10_LOGGER_ROOT.
     // If not present, the name is "bind10".
diff --git a/src/lib/log/logger_unittest_support.h b/src/lib/log/logger_unittest_support.h
index ce9121b..a879158 100644
--- a/src/lib/log/logger_unittest_support.h
+++ b/src/lib/log/logger_unittest_support.h
@@ -16,6 +16,7 @@
 #define __LOGGER_UNITTEST_SUPPORT_H
 
 #include <string>
+#include <log/dll.h>
 #include <log/logger.h>
 
 /// \file
@@ -72,6 +73,7 @@ namespace log {
 ///
 /// TODO: Rename. This function overloads the initLogger() function that can
 ///       be used to initialize production programs.  This may lead to confusion.
+B10_LIBLOG_API
 void initLogger(isc::log::Severity severity = isc::log::DEBUG,
                 int dbglevel = isc::log::MAX_DEBUG_LEVEL);
 
@@ -86,6 +88,7 @@ void initLogger(isc::log::Severity severity = isc::log::DEBUG,
 //         defined.
 ///
 /// \return Severity to use for the logging.
+B10_LIBLOG_API
 isc::log::Severity b10LoggerSeverity(isc::log::Severity defseverity);
 
 
@@ -105,6 +108,7 @@ isc::log::Severity b10LoggerSeverity(isc::log::Severity defseverity);
 ///        is not defined.
 ///
 /// \return Debug level to use.
+B10_LIBLOG_API
 int b10LoggerDbglevel(int defdbglevel);
 
 
@@ -115,7 +119,7 @@ int b10LoggerDbglevel(int defdbglevel);
 /// characteristics of the root logger to use a severity, debug level and
 /// destination set by the environment variables B10_LOGGER_SEVERITY,
 /// B10_LOGGER_DBGLEVEL and B10_LOGGER_DESTINATION.
-void
+B10_LIBLOG_API void
 resetUnitTestRootLogger();
 
 } // namespace log
diff --git a/src/lib/log/logimpl_messages.cc b/src/lib/log/logimpl_messages.cc
index ca8552e..695a37f 100644
--- a/src/lib/log/logimpl_messages.cc
+++ b/src/lib/log/logimpl_messages.cc
@@ -1,5 +1,7 @@
 // File created from logimpl_messages.mes on Wed Jun 22 10:57:02 2011
 
+#define B10_LIBLOG_EXPORT
+
 #include <cstddef>
 #include <log/message_types.h>
 #include <log/message_initializer.h>
@@ -7,9 +9,12 @@
 namespace isc {
 namespace log {
 
-extern const isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG = "LOGIMPL_ABOVE_MAX_DEBUG";
-extern const isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING = "LOGIMPL_BAD_DEBUG_STRING";
-extern const isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG = "LOGIMPL_BELOW_MIN_DEBUG";
+extern const B10_LIBLOG_API
+isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG = "LOGIMPL_ABOVE_MAX_DEBUG";
+extern const B10_LIBLOG_API
+isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING = "LOGIMPL_BAD_DEBUG_STRING";
+extern const B10_LIBLOG_API
+isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG = "LOGIMPL_BELOW_MIN_DEBUG";
 
 } // namespace log
 } // namespace isc
diff --git a/src/lib/log/logimpl_messages.h b/src/lib/log/logimpl_messages.h
index 1b94838..6d5e8f6 100644
--- a/src/lib/log/logimpl_messages.h
+++ b/src/lib/log/logimpl_messages.h
@@ -3,14 +3,15 @@
 #ifndef __LOGIMPL_MESSAGES_H
 #define __LOGIMPL_MESSAGES_H
 
+#include <log/dll.h>
 #include <log/message_types.h>
 
 namespace isc {
 namespace log {
 
-extern const isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG;
-extern const isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING;
-extern const isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG;
+extern const B10_LIBLOG_API isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG;
+extern const B10_LIBLOG_API isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING;
+extern const B10_LIBLOG_API isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG;
 
 } // namespace log
 } // namespace isc
diff --git a/src/lib/log/macros.h b/src/lib/log/macros.h
index 42fb42e..a4cb907 100644
--- a/src/lib/log/macros.h
+++ b/src/lib/log/macros.h
@@ -15,6 +15,7 @@
 #ifndef __LOG_MACROS_H
 #define __LOG_MACROS_H
 
+#include <log/dll.h>
 #include <log/logger.h>
 #include <log/log_dbglevels.h>
 
diff --git a/src/lib/log/message_dictionary.cc b/src/lib/log/message_dictionary.cc
index 3bfc56c..7eb9f7b 100644
--- a/src/lib/log/message_dictionary.cc
+++ b/src/lib/log/message_dictionary.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <cstddef>
 #include <log/message_dictionary.h>
 #include <log/message_types.h>
diff --git a/src/lib/log/message_dictionary.h b/src/lib/log/message_dictionary.h
index 519986d..12e6600 100644
--- a/src/lib/log/message_dictionary.h
+++ b/src/lib/log/message_dictionary.h
@@ -22,6 +22,7 @@
 
 #include <boost/lexical_cast.hpp>
 
+#include <log/dll.h>
 #include <log/message_types.h>
 
 namespace isc {
@@ -45,7 +46,7 @@ namespace log {
 /// Although the class can be used stand-alone, it does supply a static method
 /// to return a particular instance - the "global" dictionary.
 
-class MessageDictionary {
+class B10_LIBLOG_API MessageDictionary {
 public:
 
     typedef std::map<std::string, std::string> Dictionary;
diff --git a/src/lib/log/message_exception.h b/src/lib/log/message_exception.h
index 8b9d58a..bea29fe 100644
--- a/src/lib/log/message_exception.h
+++ b/src/lib/log/message_exception.h
@@ -16,6 +16,7 @@
 #define __MESSAGE_EXCEPTION_H
 
 #include <exceptions/exceptions.h>
+#include <log/dll.h>
 #include <log/message_types.h>
 
 #include <stdexcept>
@@ -33,7 +34,7 @@ namespace log {
 /// code and its arguments to be encapsulated in an exception and thrown
 /// up the stack.
 
-class MessageException : public isc::Exception {
+class B10_LIBLOG_API MessageException : public isc::Exception {
 public:
 
     /// \brief Constructor
diff --git a/src/lib/log/message_initializer.cc b/src/lib/log/message_initializer.cc
index 3dd5da7..e117327 100644
--- a/src/lib/log/message_initializer.cc
+++ b/src/lib/log/message_initializer.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <cassert>
 #include <cstdlib>
 #include <log/message_dictionary.h>
diff --git a/src/lib/log/message_initializer.h b/src/lib/log/message_initializer.h
index 28b0e61..2faa988 100644
--- a/src/lib/log/message_initializer.h
+++ b/src/lib/log/message_initializer.h
@@ -18,6 +18,7 @@
 #include <cstdlib>
 #include <string>
 #include <vector>
+#include <log/dll.h>
 #include <log/message_dictionary.h>
 
 namespace isc {
@@ -63,7 +64,7 @@ namespace log {
 /// global dictionary's overflow vector whence they can be retrieved at
 /// run-time.
 
-class MessageInitializer {
+class B10_LIBLOG_API MessageInitializer {
 public:
     /// Maximum number of message arrays that can be initialized in this way
     static const size_t MAX_MESSAGE_ARRAYS = 256;
diff --git a/src/lib/log/message_reader.cc b/src/lib/log/message_reader.cc
index b5a4d35..5abde8f 100644
--- a/src/lib/log/message_reader.cc
+++ b/src/lib/log/message_reader.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <cassert>
 #include <errno.h>
 #include <string.h>
diff --git a/src/lib/log/message_reader.h b/src/lib/log/message_reader.h
index a468d43..3bebfad 100644
--- a/src/lib/log/message_reader.h
+++ b/src/lib/log/message_reader.h
@@ -19,6 +19,7 @@
 #include <string>
 #include <vector>
 
+#include <log/dll.h>
 #include <log/message_dictionary.h>
 #include <log/message_types.h>
 
@@ -30,7 +31,7 @@ namespace log {
 /// Reads a message file and creates a map of identifier against the text of the
 /// message.  This map can be retrieved for subsequent processing.
 
-class MessageReader {
+class B10_LIBLOG_API MessageReader {
 public:
 
     /// \brief Read Mode
diff --git a/src/lib/log/message_types.h b/src/lib/log/message_types.h
index 9f625a9..9ac752a 100644
--- a/src/lib/log/message_types.h
+++ b/src/lib/log/message_types.h
@@ -17,6 +17,8 @@
 
 #include <string.h>
 
+#include <log/dll.h>
+
 namespace isc {
 namespace log {
 
@@ -27,7 +29,7 @@ typedef const char* MessageID;
 /// \param m1 First message ID
 /// \param m2 Second message ID
 /// \return true if they are equal, false if not
-bool equalMessageID(const MessageID& m1, const MessageID& m2);
+B10_LIBLOG_API bool equalMessageID(const MessageID& m1, const MessageID& m2);
 
 } // namespace log
 } // namespace isc
diff --git a/src/lib/log/output_option.cc b/src/lib/log/output_option.cc
index f56efb9..ed4c236 100644
--- a/src/lib/log/output_option.cc
+++ b/src/lib/log/output_option.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBLOG_EXPORT
+
 #include <string>
 
 #include <boost/algorithm/string.hpp>
diff --git a/src/lib/log/output_option.h b/src/lib/log/output_option.h
index 8dfdd70..24954df 100644
--- a/src/lib/log/output_option.h
+++ b/src/lib/log/output_option.h
@@ -19,6 +19,8 @@
 #include <stdlib.h>
 #include <string>
 
+#include <log/dll.h>
+
 /// \brief Logger Output Option
 ///
 /// The logging configuration options are a list of logger specifications, each
@@ -42,7 +44,7 @@
 namespace isc {
 namespace log {
 
-struct OutputOption {
+struct B10_LIBLOG_API OutputOption {
 
     /// Destinations.  Prefixed "DEST_" to avoid problems with the C stdio.h
     /// FILE type.
@@ -75,7 +77,9 @@ struct OutputOption {
     unsigned int    maxver;             ///< Maximum versions (none if <= 0)
 };
 
+B10_LIBLOG_API
 OutputOption::Destination getDestination(const std::string& dest_str);
+B10_LIBLOG_API
 OutputOption::Stream getStream(const std::string& stream_str);
 
 
diff --git a/src/lib/nsas/Makefile.am b/src/lib/nsas/Makefile.am
index eb8c0c3..0d29d88 100644
--- a/src/lib/nsas/Makefile.am
+++ b/src/lib/nsas/Makefile.am
@@ -37,7 +37,8 @@ lib_LTLIBRARIES = libb10-nsas.la
 BUILT_SOURCES = nsas_messages.h nsas_messages.cc
 
 # Library sources. The generated files will not be in the distribution.
-libb10_nsas_la_SOURCES  = address_entry.h address_entry.cc
+libb10_nsas_la_SOURCES  = dll.h
+libb10_nsas_la_SOURCES += address_entry.h address_entry.cc
 libb10_nsas_la_SOURCES += asiolink.h
 libb10_nsas_la_SOURCES += hash.cc hash.h
 libb10_nsas_la_SOURCES += hash_deleter.h
diff --git a/src/lib/nsas/address_entry.cc b/src/lib/nsas/address_entry.cc
index 24b0dd9..894ffc1 100644
--- a/src/lib/nsas/address_entry.cc
+++ b/src/lib/nsas/address_entry.cc
@@ -30,6 +30,8 @@
 /// static class constant, and define it in this source file.  As we can control
 /// the order of include files, this ensures that the value is defined.
 
+#define B10_LIBNSAS_EXPORT
+
 #define __STDC_LIMIT_MACROS
 #include <stdint.h>
 
diff --git a/src/lib/nsas/address_entry.h b/src/lib/nsas/address_entry.h
index 8698017..c8ccdc8 100644
--- a/src/lib/nsas/address_entry.h
+++ b/src/lib/nsas/address_entry.h
@@ -22,11 +22,12 @@
 
 #include <stdint.h>
 #include <asiolink/io_address.h>
+#include <nsas/dll.h>
 
 namespace isc {
 namespace nsas {
 
-class AddressEntry {
+class B10_LIBNSAS_API AddressEntry {
 public:
     /// Creates an address entry given IOAddress entry and RTT
     /// This is the only constructor; the default copy constructor and
diff --git a/src/lib/nsas/address_request_callback.h b/src/lib/nsas/address_request_callback.h
index ad0630e..8a65515 100644
--- a/src/lib/nsas/address_request_callback.h
+++ b/src/lib/nsas/address_request_callback.h
@@ -15,6 +15,7 @@
 #ifndef __ADDRESS_REQUEST_CALLBACK_H
 #define __ADDRESS_REQUEST_CALLBACK_H
 
+#include <nsas/dll.h>
 #include "asiolink.h"
 #include "nameserver_address.h"
 
@@ -39,7 +40,7 @@ namespace nsas {
 /// callback object is up to the caller - if the caller wants to retain it
 /// they should keep the shared pointer.
 
-class AddressRequestCallback {
+class B10_LIBNSAS_API AddressRequestCallback {
 public:
 
     /// Default constructor, copy contructor and assignment operator
diff --git a/src/lib/nsas/dll.h b/src/lib/nsas/dll.h
new file mode 100644
index 0000000..8645e55
--- /dev/null
+++ b/src/lib/nsas/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBNSAS_H
+#define __LIBNSAS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBNSAS_API
+#else
+#ifdef B10_LIBNSAS_EXPORT
+#define B10_LIBNSAS_API __declspec(dllexport)
+#else
+#define B10_LIBNSAS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBNSAS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/nsas/fetchable.h b/src/lib/nsas/fetchable.h
index 461cfca..4f3eef8 100644
--- a/src/lib/nsas/fetchable.h
+++ b/src/lib/nsas/fetchable.h
@@ -15,6 +15,8 @@
 #ifndef __FETCHABLE_H
 #define __FETCHABLE_H
 
+#include <nsas/dll.h>
+
 /**
  * \file fetchable.h
  * \short Interface of information that can be fetched.
@@ -29,7 +31,7 @@ namespace nsas {
  * This just holds a state of information that can be fetched from somewhere.
  * No locking is performed, if it is desirable, it should be locked manually.
  */
-class Fetchable {
+class B10_LIBNSAS_API Fetchable {
     public:
         /// \short States the Fetchable object can be in.
         enum State {
diff --git a/src/lib/nsas/glue_hints.cc b/src/lib/nsas/glue_hints.cc
index 3caae25..6a2b53a 100644
--- a/src/lib/nsas/glue_hints.cc
+++ b/src/lib/nsas/glue_hints.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include "glue_hints.h"
 
 #include <stdlib.h>
diff --git a/src/lib/nsas/glue_hints.h b/src/lib/nsas/glue_hints.h
index 8e6ecf1..5cc2a5c 100644
--- a/src/lib/nsas/glue_hints.h
+++ b/src/lib/nsas/glue_hints.h
@@ -19,13 +19,14 @@
 
 #include <dns/message.h>
 
+#include <nsas/dll.h>
 #include "nsas_types.h"
 #include "nameserver_address.h"
 
 namespace isc {
 namespace nsas {
 
-class GlueHints {
+class B10_LIBNSAS_API GlueHints {
 public:
     /// \brief Empty constructor
     GlueHints() {};
diff --git a/src/lib/nsas/hash.cc b/src/lib/nsas/hash.cc
index ac2af15..b695f82 100644
--- a/src/lib/nsas/hash.cc
+++ b/src/lib/nsas/hash.cc
@@ -52,6 +52,8 @@ or otherwise) arising in any way out of the use of this software, even
 if advised of the possibility of such damage.
 */
 
+#define B10_LIBNSAS_EXPORT
+
 #include <cassert>
 #include <stdlib.h>
 #include <algorithm>
diff --git a/src/lib/nsas/hash.h b/src/lib/nsas/hash.h
index 85b82c3..da8993f 100644
--- a/src/lib/nsas/hash.h
+++ b/src/lib/nsas/hash.h
@@ -20,6 +20,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 
 namespace isc {
@@ -29,7 +30,7 @@ namespace nsas {
 ///
 /// Thrown if the expected maximum key length is too long for the data types
 /// declared in the class.
-class KeyLengthTooLong : public isc::Exception {
+class B10_LIBNSAS_API KeyLengthTooLong : public isc::Exception {
 public:
     KeyLengthTooLong(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -40,7 +41,7 @@ public:
 /// \brief Hash Calculation
 ///
 /// Class abstracting the mechanics of the hash calculation.
-class Hash {
+class B10_LIBNSAS_API Hash {
 public:
 
     /// \brief Constructor
diff --git a/src/lib/nsas/hash_deleter.h b/src/lib/nsas/hash_deleter.h
index 8b3c2b8..de4de61 100644
--- a/src/lib/nsas/hash_deleter.h
+++ b/src/lib/nsas/hash_deleter.h
@@ -19,6 +19,7 @@
 #include <util/lru_list.h>
 #include <util/nonassignable.h>
 
+#include <nsas/dll.h>
 #include "hash_table.h"
 
 namespace isc {
diff --git a/src/lib/nsas/hash_key.cc b/src/lib/nsas/hash_key.cc
index 782e3d8..5c8a35d 100644
--- a/src/lib/nsas/hash_key.cc
+++ b/src/lib/nsas/hash_key.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include <cstring>
 
 #include <config.h>
diff --git a/src/lib/nsas/hash_key.h b/src/lib/nsas/hash_key.h
index c89b327..d2869c9 100644
--- a/src/lib/nsas/hash_key.h
+++ b/src/lib/nsas/hash_key.h
@@ -16,6 +16,7 @@
 #define __HASH_KEY_H
 
 #include <dns/rrclass.h>
+#include <nsas/dll.h>
 
 #include <stdint.h>
 #include <string>
@@ -41,7 +42,7 @@ namespace nsas {
 ///
 /// To avoid passing round three elements (key, key length, and class), they
 /// have been combined into this simple struct.
-struct HashKey {
+struct B10_LIBNSAS_API HashKey {
 
     /// \brief Constructor
     ///
diff --git a/src/lib/nsas/hash_table.h b/src/lib/nsas/hash_table.h
index 6028473..c788bd5 100644
--- a/src/lib/nsas/hash_table.h
+++ b/src/lib/nsas/hash_table.h
@@ -21,6 +21,7 @@
 
 #include <util/locks.h>
 
+#include <nsas/dll.h>
 #include "hash.h"
 #include "hash_key.h"
 
diff --git a/src/lib/nsas/nameserver_address.cc b/src/lib/nsas/nameserver_address.cc
index 19d18c5..1c3a009 100644
--- a/src/lib/nsas/nameserver_address.cc
+++ b/src/lib/nsas/nameserver_address.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include <config.h>
 
 #include "nameserver_address.h"
diff --git a/src/lib/nsas/nameserver_address.h b/src/lib/nsas/nameserver_address.h
index 07b6d4a..f367aeb 100644
--- a/src/lib/nsas/nameserver_address.h
+++ b/src/lib/nsas/nameserver_address.h
@@ -19,6 +19,7 @@
 
 #include <exceptions/exceptions.h>
 
+#include <nsas/dll.h>
 #include "asiolink.h"
 #include "address_entry.h"
 #include "nsas_types.h"
@@ -26,14 +27,14 @@
 namespace isc {
 namespace nsas {
 
-class ZoneEntry;
-class NameserverEntry;
+class B10_LIBNSAS_API ZoneEntry;
+class B10_LIBNSAS_API NameserverEntry;
 
 /// \brief Empty \c NameserverEntry pointer exception
 ///
 /// Thrown if the the \c NameservrEntry pointer in the \c boost::shared_ptr that passed
 /// into \c NameserverAddress' constructor is NULL
-class NullNameserverEntryPointer : public isc::Exception {
+class B10_LIBNSAS_API NullNameserverEntryPointer : public isc::Exception {
 public:
     NullNameserverEntryPointer(const char* file, size_t line,
         const char* what) :
@@ -52,7 +53,7 @@ public:
 /// It is not thread safe, only reentrant. It is expected to be kept inside
 /// the resolver and used only once for the address and once for the update.
 
-class NameserverAddress {
+class B10_LIBNSAS_API NameserverAddress {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/nsas/nameserver_address_store.cc b/src/lib/nsas/nameserver_address_store.cc
index 867f028..528bbd3 100644
--- a/src/lib/nsas/nameserver_address_store.cc
+++ b/src/lib/nsas/nameserver_address_store.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include <config.h>
 
 #include <boost/shared_ptr.hpp>
diff --git a/src/lib/nsas/nameserver_address_store.h b/src/lib/nsas/nameserver_address_store.h
index 1af535a..47b0773 100644
--- a/src/lib/nsas/nameserver_address_store.h
+++ b/src/lib/nsas/nameserver_address_store.h
@@ -22,6 +22,7 @@
 
 #include <resolve/resolver_interface.h>
 
+#include <nsas/dll.h>
 #include "nsas_types.h"
 #include "glue_hints.h"
 
@@ -29,7 +30,7 @@ namespace isc {
 // Some forward declarations, so we do not need to include so many headers
 
 namespace dns {
-class RRClass;
+class B10_LIBNSAS_API RRClass;
 }
 
 namespace util {
@@ -39,9 +40,9 @@ template<class T> class LruList;
 namespace nsas {
 
 template<class T> class HashTable;
-class ZoneEntry;
-class NameserverEntry;
-class AddressRequestCallback;
+class B10_LIBNSAS_API ZoneEntry;
+class B10_LIBNSAS_API NameserverEntry;
+class B10_LIBNSAS_API AddressRequestCallback;
 
 /// \brief Nameserver Address Store
 ///
@@ -50,7 +51,7 @@ class AddressRequestCallback;
 /// the logic for sending queries for the nameserver addresses if they are not
 /// in the store.
 
-class NameserverAddressStore {
+class B10_LIBNSAS_API NameserverAddressStore {
 public:
 
     /// \brief Constructor
diff --git a/src/lib/nsas/nameserver_entry.cc b/src/lib/nsas/nameserver_entry.cc
index bca8f73..d2a6268 100644
--- a/src/lib/nsas/nameserver_entry.cc
+++ b/src/lib/nsas/nameserver_entry.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include <config.h>
 
 #include <algorithm>
diff --git a/src/lib/nsas/nameserver_entry.h b/src/lib/nsas/nameserver_entry.h
index 0f214c6..d3d6ee7 100644
--- a/src/lib/nsas/nameserver_entry.h
+++ b/src/lib/nsas/nameserver_entry.h
@@ -27,6 +27,7 @@
 
 #include <util/lru_list.h>
 
+#include <nsas/dll.h>
 #include "address_entry.h"
 #include "asiolink.h"
 #include "nsas_types.h"
@@ -38,13 +39,13 @@
 namespace isc {
 namespace nsas {
 
-class NameserverAddress;
+class B10_LIBNSAS_API NameserverAddress;
 
 /// \brief Inconsistent Owner Names
 ///
 /// Thrown if a NameserverEntry is constructed from both an A and AAAA RRset
 /// where the owner names do not match.
-class InconsistentOwnerNames : public Exception {
+class B10_LIBNSAS_API InconsistentOwnerNames : public Exception {
 public:
     InconsistentOwnerNames(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -54,7 +55,7 @@ public:
 /// \brief RTT is zero
 ///
 /// Thrown if a RTT related with an address is 0.
-class RTTIsZero : public Exception {
+class B10_LIBNSAS_API RTTIsZero : public Exception {
 public:
     RTTIsZero(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
@@ -65,14 +66,14 @@ public:
 ///
 /// Thrown if a NameserverEntry is constructed from both an A and AAAA RRset
 /// where the classes do not match.
-class InconsistentClass : public Exception {
+class B10_LIBNSAS_API InconsistentClass : public Exception {
 public:
     InconsistentClass(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what)
     {}
 };
 
-class ZoneEntry;
+class B10_LIBNSAS_API ZoneEntry;
 
 /// \brief Nameserver Entry
 ///
@@ -91,7 +92,8 @@ class ZoneEntry;
 ///
 /// It uses shared_from_this in its methods. It must live inside a shared_ptr.
 
-class NameserverEntry : public NsasEntry<NameserverEntry>, public Fetchable {
+class B10_LIBNSAS_API NameserverEntry :
+    public NsasEntry<NameserverEntry>, public Fetchable {
 public:
     /// List of addresses associated with this nameserver
     typedef std::vector<NameserverAddress>   AddressVector;
diff --git a/src/lib/nsas/nsas_entry.h b/src/lib/nsas/nsas_entry.h
index 9cbed11..54669a1 100644
--- a/src/lib/nsas/nsas_entry.h
+++ b/src/lib/nsas/nsas_entry.h
@@ -21,6 +21,7 @@
 #include <exceptions/exceptions.h>
 #include <util/lru_list.h>
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "hash_table.h"
 
@@ -31,7 +32,7 @@ namespace nsas {
 ///
 /// Thrown if an attempt was made to access the iterator - the pointer into
 /// the LRU list where this element is located - when it is marked as invalid.
-class InvalidLruIterator : public isc::Exception {
+class B10_LIBNSAS_API InvalidLruIterator : public isc::Exception {
 public:
     InvalidLruIterator(const char* file, size_t line, const char* what) :
         Exception(file, line, what)
diff --git a/src/lib/nsas/nsas_entry_compare.h b/src/lib/nsas/nsas_entry_compare.h
index 9e9ba7d..78a8b8e 100644
--- a/src/lib/nsas/nsas_entry_compare.h
+++ b/src/lib/nsas/nsas_entry_compare.h
@@ -15,6 +15,7 @@
 #ifndef __NSAS_ENTRY_COMPARE_H
 #define __NSAS_ENTRY_COMPARE_H
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "hash_table.h"
 
diff --git a/src/lib/nsas/nsas_log.cc b/src/lib/nsas/nsas_log.cc
index 931b131..8196f51 100644
--- a/src/lib/nsas/nsas_log.cc
+++ b/src/lib/nsas/nsas_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the NSAS
 
+#define B10_LIBNSAS_EXPORT
+
 #include "nsas/nsas_log.h"
 
 namespace isc {
diff --git a/src/lib/nsas/nsas_log.h b/src/lib/nsas/nsas_log.h
index 031f46d..8872a52 100644
--- a/src/lib/nsas/nsas_log.h
+++ b/src/lib/nsas/nsas_log.h
@@ -16,6 +16,7 @@
 #define __NSAS_LOG__H
 
 #include <log/macros.h>
+#include <nsas/dll.h>
 #include "nsas_messages.h"
 
 namespace isc {
diff --git a/src/lib/nsas/nsas_types.h b/src/lib/nsas/nsas_types.h
index 940cc3e..828fcad 100644
--- a/src/lib/nsas/nsas_types.h
+++ b/src/lib/nsas/nsas_types.h
@@ -15,6 +15,8 @@
 #ifndef __NSAS_TYPES_H
 #define __NSAS_TYPES_H
 
+#include <nsas/dll.h>
+
 /// \file nsas_types.h
 /// \brief Nameserver Address Store Types
 ///
diff --git a/src/lib/nsas/zone_entry.cc b/src/lib/nsas/zone_entry.cc
index 722354c..06053ad 100644
--- a/src/lib/nsas/zone_entry.cc
+++ b/src/lib/nsas/zone_entry.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBNSAS_EXPORT
+
 #include <map>
 
 #include <config.h>
diff --git a/src/lib/nsas/zone_entry.h b/src/lib/nsas/zone_entry.h
index 486357c..82415a7 100644
--- a/src/lib/nsas/zone_entry.h
+++ b/src/lib/nsas/zone_entry.h
@@ -29,6 +29,7 @@
 #include <util/locks.h>
 #include <util/random/random_number_generator.h>
 
+#include <nsas/dll.h>
 #include "hash_key.h"
 #include "nsas_entry.h"
 #include "asiolink.h"
@@ -39,8 +40,8 @@
 namespace isc {
 namespace nsas {
 
-class NameserverEntry;
-class AddressRequestCallback;
+class B10_LIBNSAS_API NameserverEntry;
+class B10_LIBNSAS_API AddressRequestCallback;
 
 /// \brief Zone Entry
 ///
@@ -53,7 +54,7 @@ class AddressRequestCallback;
 ///
 /// It uses shared_from_this in its methods. It must live inside a shared_ptr.
 
-class ZoneEntry : isc::util::nonassignable,
+class B10_LIBNSAS_API ZoneEntry : isc::util::nonassignable,
     public NsasEntry<ZoneEntry>, public Fetchable {
 public:
 
diff --git a/src/lib/resolve/Makefile.am b/src/lib/resolve/Makefile.am
index 096a14d..64e4831 100644
--- a/src/lib/resolve/Makefile.am
+++ b/src/lib/resolve/Makefile.am
@@ -22,7 +22,8 @@ BUILT_SOURCES = resolve_messages.h resolve_messages.cc
 CLEANFILES = *.gcno *.gcda resolve_messages.cc resolve_messages.h
 
 lib_LTLIBRARIES = libb10-resolve.la
-libb10_resolve_la_SOURCES = resolve.h resolve.cc
+libb10_resolve_la_SOURCES  = dll.h
+libb10_resolve_la_SOURCES += resolve.h resolve.cc
 libb10_resolve_la_SOURCES += resolve_log.h resolve_log.cc
 libb10_resolve_la_SOURCES += resolver_interface.h
 libb10_resolve_la_SOURCES += resolver_callback.h resolver_callback.cc
diff --git a/src/lib/resolve/dll.h b/src/lib/resolve/dll.h
new file mode 100644
index 0000000..afa0317
--- /dev/null
+++ b/src/lib/resolve/dll.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBRESOLVE_H
+#define __LIBRESOLVE_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBRESOLVE_API
+#else
+#ifdef B10_LIBRESOLVE_EXPORT
+#define B10_LIBRESOLVE_API __declspec(dllexport)
+#else
+#define B10_LIBRESOLVE_API __declspec(dllimport)
+#endif
+#endif
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBNSASRESOLVE_API
+#else
+#if defined(B10_LIBNSAS_EXPORT) || defined(B10_LIBRESOLVE_EXPORT)
+#define B10_LIBNSASRESOLVE_API __declspec(dllexport)
+#else
+#define B10_LIBNSASRESOLVE_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBRESOLVE_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc
index 8d03c1c..2f5e6d1 100644
--- a/src/lib/resolve/recursive_query.cc
+++ b/src/lib/resolve/recursive_query.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBRESOLVE_EXPORT
+
 #include <config.h>
 
 #include <stdlib.h>
@@ -87,7 +89,7 @@ questionText(const isc::dns::Question& question) {
 /// \param name The name we want to delegate to.
 /// \param rrclass The class.
 /// \param cache The place too look for known delegations.
-std::string
+B10_LIBRESOLVE_API std::string
 deepestDelegation(Name name, RRClass rrclass,
                   isc::cache::ResolverCache& cache)
 {
@@ -898,7 +900,7 @@ public:
     }
 };
 
-class ForwardQuery : public IOFetch::Callback {
+class B10_LIBRESOLVE_API ForwardQuery : public IOFetch::Callback {
 private:
     // The io service to handle async calls
     IOService& io_;
diff --git a/src/lib/resolve/recursive_query.h b/src/lib/resolve/recursive_query.h
index c17c98c..1f644a4 100644
--- a/src/lib/resolve/recursive_query.h
+++ b/src/lib/resolve/recursive_query.h
@@ -21,6 +21,7 @@
 #include <asiodns/dns_server.h>
 #include <nsas/nameserver_address_store.h>
 #include <cache/resolver_cache.h>
+#include <resolve/dll.h>
 
 namespace isc {
 namespace asiodns {
@@ -33,7 +34,7 @@ namespace asiodns {
 /// A pointer to an object of this class is passed to RecursiveQuery which in
 /// turn passes it to the created RunningQuery class.  When a running query
 /// completes, its RTT is passed to the RTT Recorder object.
-class RttRecorder {
+class B10_LIBRESOLVE_API RttRecorder {
 public:
     /// \brief Record Time
     ///
@@ -59,7 +60,7 @@ private:
 /// The \c RecursiveQuery class provides a layer of abstraction around
 /// the ASIO code that carries out an upstream query.
 
-class RecursiveQuery : isc::util::nonassignable {
+class B10_LIBRESOLVE_API RecursiveQuery : isc::util::nonassignable {
     ///
     /// \name Constructors
     ///
diff --git a/src/lib/resolve/resolve.cc b/src/lib/resolve/resolve.cc
index 24cd356..7fd0338 100644
--- a/src/lib/resolve/resolve.cc
+++ b/src/lib/resolve/resolve.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBRESOLVE_EXPORT
+
 #include <util/nonassignable.h>
 
 #include <resolve/resolve.h>
@@ -38,7 +40,7 @@ namespace {
 namespace isc {
 namespace resolve {
 
-void
+B10_LIBRESOLVE_API void
 makeErrorMessage(MessagePtr answer_message,
                  const Rcode& error_code)
 {
@@ -49,8 +51,9 @@ makeErrorMessage(MessagePtr answer_message,
     answer_message->setRcode(error_code);
 }
 
-void initResponseMessage(const isc::dns::Message& query_message,
-                         isc::dns::Message& response_message)
+B10_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Message& query_message,
+                    isc::dns::Message& response_message)
 {
     response_message.setOpcode(query_message.getOpcode());
     response_message.setQid(query_message.getQid());
@@ -59,14 +62,16 @@ void initResponseMessage(const isc::dns::Message& query_message,
         query_message);
 }
 
-void initResponseMessage(const isc::dns::Question& question,
-                         isc::dns::Message& response_message)
+B10_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Question& question,
+                    isc::dns::Message& response_message)
 {
     response_message.setOpcode(isc::dns::Opcode::QUERY());
     response_message.addQuestion(question);
 }
 
-void copyResponseMessage(const Message& source, MessagePtr target) {
+B10_LIBRESOLVE_API void
+copyResponseMessage(const Message& source, MessagePtr target) {
     target->setRcode(source.getRcode());
 
     target->appendSection(Message::SECTION_ANSWER, source);
diff --git a/src/lib/resolve/resolve.h b/src/lib/resolve/resolve.h
index 0a588e2..40e1488 100644
--- a/src/lib/resolve/resolve.h
+++ b/src/lib/resolve/resolve.h
@@ -18,6 +18,7 @@
 /// This file includes all other libresolve headers, and provides
 /// several helper functions used in resolving.
 
+#include <resolve/dll.h>
 #include <resolve/resolver_interface.h>
 #include <resolve/resolver_callback.h>
 #include <resolve/response_classifier.h>
@@ -38,8 +39,9 @@ namespace resolve {
 ///
 /// \param answer_message The message to clear and place the error in
 /// \param error_code The error Rcode
-void makeErrorMessage(isc::dns::MessagePtr answer_message,
-                      const isc::dns::Rcode& error_code);
+B10_LIBRESOLVE_API void
+makeErrorMessage(isc::dns::MessagePtr answer_message,
+                 const isc::dns::Rcode& error_code);
 
 
 /// \brief Initialize a response message
@@ -56,8 +58,9 @@ void makeErrorMessage(isc::dns::MessagePtr answer_message,
 ///                      and Opcode from.
 /// \param response_message The fresh response message to initialize
 ///                         (must be in RENDER mode)
-void initResponseMessage(const isc::dns::Message& query_message,
-                         isc::dns::Message& response_message);
+B10_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Message& query_message,
+                    isc::dns::Message& response_message);
 
 
 /// \brief Initialize a response message
@@ -73,8 +76,9 @@ void initResponseMessage(const isc::dns::Message& query_message,
 /// \param question The question to place in the Question section
 /// \param response_message The fresh response message to initialize
 ///                         (must be in RENDER mode)
-void initResponseMessage(const isc::dns::Question& question,
-                         isc::dns::Message& response_message);
+B10_LIBRESOLVE_API void
+initResponseMessage(const isc::dns::Question& question,
+                    isc::dns::Message& response_message);
 
 
 /// \brief Copies the parts relevant for a DNS response to the
@@ -85,8 +89,9 @@ void initResponseMessage(const isc::dns::Question& question,
 /// code
 /// \param source The Message to copy the data from
 /// \param target The Message to copy the data to
-void copyResponseMessage(const isc::dns::Message& source,
-                         isc::dns::MessagePtr target);
+B10_LIBRESOLVE_API void
+copyResponseMessage(const isc::dns::Message& source,
+                    isc::dns::MessagePtr target);
 
 
 } // namespace resolve
diff --git a/src/lib/resolve/resolve_log.cc b/src/lib/resolve/resolve_log.cc
index e41d8d2..7dd3294 100644
--- a/src/lib/resolve/resolve_log.cc
+++ b/src/lib/resolve/resolve_log.cc
@@ -14,6 +14,8 @@
 
 /// Defines the logger used by the NSAS
 
+#define B10_LIBRESOLVE_EXPORT
+
 #include <resolve/resolve_log.h>
 
 namespace isc {
diff --git a/src/lib/resolve/resolve_log.h b/src/lib/resolve/resolve_log.h
index 828b9d3..9136ae2 100644
--- a/src/lib/resolve/resolve_log.h
+++ b/src/lib/resolve/resolve_log.h
@@ -16,6 +16,7 @@
 #define __RESOLVE_LOG__H
 
 #include <log/macros.h>
+#include <resolve/dll.h>
 #include "resolve_messages.h"
 
 namespace isc {
diff --git a/src/lib/resolve/resolver_callback.cc b/src/lib/resolve/resolver_callback.cc
index c0db55e..d14e5c4 100644
--- a/src/lib/resolve/resolver_callback.cc
+++ b/src/lib/resolve/resolver_callback.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBRESOLVE_EXPORT
+
 #include <resolve/resolver_callback.h>
 
 namespace isc {
diff --git a/src/lib/resolve/resolver_callback.h b/src/lib/resolve/resolver_callback.h
index 79138e8..64ac426 100644
--- a/src/lib/resolve/resolver_callback.h
+++ b/src/lib/resolve/resolver_callback.h
@@ -18,6 +18,7 @@
 #include <asiodns/dns_server.h>
 #include <dns/message.h>
 
+#include <resolve/dll.h>
 #include <resolve/resolver_interface.h>
 
 namespace isc {
@@ -31,7 +32,8 @@ namespace resolve {
 ///
 /// This class will ignore the response MessagePtr in the callback,
 /// as the server itself should also have a reference.
-class ResolverCallbackServer : public ResolverInterface::Callback {
+class B10_LIBRESOLVE_API ResolverCallbackServer :
+    public ResolverInterface::Callback {
 public:
     ResolverCallbackServer(asiodns::DNSServer* server) :
         server_(server->clone()) {}
diff --git a/src/lib/resolve/resolver_interface.h b/src/lib/resolve/resolver_interface.h
index 1d01e90..3d835ef 100644
--- a/src/lib/resolve/resolver_interface.h
+++ b/src/lib/resolve/resolver_interface.h
@@ -16,6 +16,7 @@
 #define __RESOLVER_INTERFACE_H
 
 #include <dns/message.h>
+#include <resolve/dll.h>
 
 ///
 /// \file resolver_interface.h
@@ -44,7 +45,7 @@ namespace resolve {
 ///
 /// It is abstract to allow tests pass dummy resolvers.
 ///
-class ResolverInterface {
+class B10_LIBNSASRESOLVE_API ResolverInterface {
     public:
         /// \short An abstract callback for when the resolver is done.
         ///
diff --git a/src/lib/resolve/response_classifier.cc b/src/lib/resolve/response_classifier.cc
index 27c5cfc..f6137ea 100644
--- a/src/lib/resolve/response_classifier.cc
+++ b/src/lib/resolve/response_classifier.cc
@@ -14,6 +14,8 @@
 
 // $Id$
 
+#define B10_LIBRESOLVE_EXPORT
+
 #include <cstddef>
 #include <vector>
 
diff --git a/src/lib/resolve/response_classifier.h b/src/lib/resolve/response_classifier.h
index a027bd0..83bea73 100644
--- a/src/lib/resolve/response_classifier.h
+++ b/src/lib/resolve/response_classifier.h
@@ -22,6 +22,7 @@
 #include <dns/question.h>
 #include <dns/message.h>
 #include <dns/question.h>
+#include <resolve/dll.h>
 
 #define RESOLVER_MAX_CNAME_CHAIN    16
 
@@ -35,7 +36,7 @@ namespace resolve {
 ///
 /// TODO: The code here does not take into account any EDNS0 fields.
 
-class ResponseClassifier {
+class B10_LIBRESOLVE_API ResponseClassifier {
 public:
 
     /// \brief Category of Answer
diff --git a/src/lib/server_common/Makefile.am b/src/lib/server_common/Makefile.am
index cf9059a..cb3f8ff 100644
--- a/src/lib/server_common/Makefile.am
+++ b/src/lib/server_common/Makefile.am
@@ -17,7 +17,8 @@ AM_CXXFLAGS += -Wno-unused-parameter
 endif
 
 lib_LTLIBRARIES = libb10-server-common.la
-libb10_server_common_la_SOURCES = client.h client.cc
+libb10_server_common_la_SOURCES  = dll.h
+libb10_server_common_la_SOURCES += client.h client.cc
 libb10_server_common_la_SOURCES += keyring.h keyring.cc
 libb10_server_common_la_SOURCES += portconfig.h portconfig.cc
 libb10_server_common_la_SOURCES += logger.h logger.cc
diff --git a/src/lib/server_common/client.cc b/src/lib/server_common/client.cc
index 30e0ef6..4c29c66 100644
--- a/src/lib/server_common/client.cc
+++ b/src/lib/server_common/client.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSERVER_COMMON_EXPORT
+
 #include <string>
 #include <sstream>
 
@@ -64,7 +66,7 @@ Client::toText() const {
     return (ss.str());
 }
 
-std::ostream&
+B10_LIBSERVER_COMMON_API std::ostream&
 isc::server_common::operator<<(std::ostream& os, const Client& client) {
     return (os << client.toText());
 }
diff --git a/src/lib/server_common/client.h b/src/lib/server_common/client.h
index ec0e352..3e37632 100644
--- a/src/lib/server_common/client.h
+++ b/src/lib/server_common/client.h
@@ -20,15 +20,16 @@
 
 #include <util/noncopyable.h>
 #include <acl/ip_check.h>
+#include <server_common/dll.h>
 
 namespace isc {
 namespace asiolink {
-class IOMessage;
-class IOEndpoint;
+class B10_LIBSERVER_COMMON_API IOMessage;
+class B10_LIBSERVER_COMMON_API IOEndpoint;
 }
 
 namespace acl {
-struct IPAddress;
+struct B10_LIBSERVER_COMMON_API IPAddress;
 }
 
 namespace server_common {
@@ -66,7 +67,7 @@ namespace server_common {
 /// We might also want to separate DNS clients for authoritative servers
 /// and clients for the resolver, especially because the former could be
 /// simpler with performance optimizations.
-class Client : isc::util::noncopyable {
+class B10_LIBSERVER_COMMON_API Client : isc::util::noncopyable {
 public:
     ///
     /// \name Constructors and Destructor
@@ -142,7 +143,8 @@ private:
 /// \param client A reference to a \c Client object output by the operation.
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
-std::ostream& operator<<(std::ostream& os, const Client& client);
+B10_LIBSERVER_COMMON_API std::ostream&
+operator<<(std::ostream& os, const Client& client);
 }
 }
 
diff --git a/src/lib/server_common/dll.h b/src/lib/server_common/dll.h
new file mode 100644
index 0000000..a53c6e5
--- /dev/null
+++ b/src/lib/server_common/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBSERVER_COMMON_H
+#define __LIBSERVER_COMMON_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBSERVER_COMMON_API
+#else
+#ifdef B10_LIBSERVER_COMMON_EXPORT
+#define B10_LIBSERVER_COMMON_API __declspec(dllexport)
+#else
+#define B10_LIBSERVER_COMMON_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBSERVER_COMMON_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/server_common/keyring.cc b/src/lib/server_common/keyring.cc
index 501dfd9..4a7076a 100644
--- a/src/lib/server_common/keyring.cc
+++ b/src/lib/server_common/keyring.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSERVER_COMMON_EXPORT
+
 #include <server_common/keyring.h>
 #include <server_common/logger.h>
 
@@ -23,7 +25,7 @@ namespace server_common {
 
 typedef boost::shared_ptr<TSIGKeyRing> KeyringPtr;
 
-KeyringPtr keyring;
+B10_LIBSERVER_COMMON_API KeyringPtr keyring;
 
 namespace {
 
@@ -46,7 +48,7 @@ updateKeyring(const std::string&, ConstElementPtr data,
 
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 initKeyring(config::ModuleCCSession& session) {
     if (keyring) {
         // We are already initialized
@@ -56,7 +58,7 @@ initKeyring(config::ModuleCCSession& session) {
     session.addRemoteConfig("tsig_keys", updateKeyring, false);
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 deinitKeyring(config::ModuleCCSession& session) {
     if (!keyring) {
         // Not initialized, ignore it
diff --git a/src/lib/server_common/keyring.h b/src/lib/server_common/keyring.h
index 9c067e9..e5c08c9 100644
--- a/src/lib/server_common/keyring.h
+++ b/src/lib/server_common/keyring.h
@@ -18,6 +18,7 @@
 #include <boost/shared_ptr.hpp>
 #include <dns/tsigkey.h>
 #include <config/ccsession.h>
+#include <server_common/dll.h>
 
 /**
  * \file keyring.h
@@ -55,7 +56,7 @@ namespace server_common {
  * but you need to call initKeyring first, otherwise you'll find a NULL pointer
  * here only.
  */
-extern boost::shared_ptr<dns::TSIGKeyRing> keyring;
+extern B10_LIBSERVER_COMMON_API boost::shared_ptr<dns::TSIGKeyRing> keyring;
 
 /**
  * \brief Load the key ring for the first time
@@ -71,7 +72,7 @@ extern boost::shared_ptr<dns::TSIGKeyRing> keyring;
  *
  * \param session The configuration session used to talk to the config manager.
  */
-void
+B10_LIBSERVER_COMMON_API void
 initKeyring(config::ModuleCCSession& session);
 
 /**
@@ -93,7 +94,7 @@ initKeyring(config::ModuleCCSession& session);
  *     as walidity should have been checked already in the config manager, or
  *     throw? What about when we get an update and it's invalid?
  */
-void
+B10_LIBSERVER_COMMON_API void
 deinitKeyring(config::ModuleCCSession& session);
 
 }
diff --git a/src/lib/server_common/logger.cc b/src/lib/server_common/logger.cc
index 0b9ab6e..9b68b5c 100644
--- a/src/lib/server_common/logger.cc
+++ b/src/lib/server_common/logger.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSERVER_COMMON_EXPORT
+
 #include <server_common/logger.h>
 
 namespace isc {
diff --git a/src/lib/server_common/logger.h b/src/lib/server_common/logger.h
index 80bc81d..86307d1 100644
--- a/src/lib/server_common/logger.h
+++ b/src/lib/server_common/logger.h
@@ -16,6 +16,7 @@
 #define __SERVER_COMMON_LOGGER_H
 
 #include <log/macros.h>
+#include <server_common/dll.h>
 #include <server_common/server_common_messages.h>
 
 /// \file server_common/logger.h
diff --git a/src/lib/server_common/portconfig.cc b/src/lib/server_common/portconfig.cc
index 530c919..f93b726 100644
--- a/src/lib/server_common/portconfig.cc
+++ b/src/lib/server_common/portconfig.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSERVER_COMMON_EXPORT
+
 #include <server_common/portconfig.h>
 #include <server_common/logger.h>
 #include <server_common/socket_request.h>
@@ -31,7 +33,7 @@ namespace isc {
 namespace server_common {
 namespace portconfig {
 
-AddressList
+B10_LIBSERVER_COMMON_API AddressList
 parseAddresses(isc::data::ConstElementPtr addresses,
                const std::string& elemName)
 {
@@ -108,7 +110,7 @@ setAddresses(DNSServiceBase& service, const AddressList& addresses,
 
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 installListenAddresses(const AddressList& new_addresses,
                        AddressList& address_store,
                        DNSServiceBase& service,
diff --git a/src/lib/server_common/portconfig.h b/src/lib/server_common/portconfig.h
index 0795728..a509bd3 100644
--- a/src/lib/server_common/portconfig.h
+++ b/src/lib/server_common/portconfig.h
@@ -19,6 +19,8 @@
 
 #include <asiodns/dns_service.h>
 
+#include <server_common/dll.h>
+
 #include <utility>
 #include <string>
 #include <stdint.h>
@@ -77,7 +79,7 @@ typedef std::vector<AddressPair> AddressList;
  *     element in the hash, port number out of range).
  * \throw std::bad_alloc when allocation fails.
  */
-AddressList
+B10_LIBSERVER_COMMON_API AddressList
 parseAddresses(isc::data::ConstElementPtr addresses,
                const std::string& elemName);
 
@@ -111,7 +113,7 @@ parseAddresses(isc::data::ConstElementPtr addresses,
 /// \throw std::bad_alloc when allocation fails.
 /// \throw isc::InvalidOperation when the function is called and the
 ///     SocketRequestor isn't initialized yet.
-void
+B10_LIBSERVER_COMMON_API void
 installListenAddresses(const AddressList& new_addresses,
                        AddressList& address_store,
                        asiodns::DNSServiceBase& dns_service,
diff --git a/src/lib/server_common/socket_request.cc b/src/lib/server_common/socket_request.cc
index e471ad0..eb88566 100644
--- a/src/lib/server_common/socket_request.cc
+++ b/src/lib/server_common/socket_request.cc
@@ -11,6 +11,9 @@
 // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBSERVER_COMMON_EXPORT
+
 #include <config.h>
 
 #include "socket_request.h"
@@ -388,7 +391,7 @@ private:
 
 }
 
-SocketRequestor&
+B10_LIBSERVER_COMMON_API SocketRequestor&
 socketRequestor() {
     if (requestor != NULL) {
         return (*requestor);
@@ -397,7 +400,7 @@ socketRequestor() {
     }
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 initSocketRequestor(cc::AbstractSession& session,
                     const std::string& app_name)
 {
@@ -409,12 +412,12 @@ initSocketRequestor(cc::AbstractSession& session,
     }
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 initTestSocketRequestor(SocketRequestor* new_requestor) {
     requestor = new_requestor;
 }
 
-void
+B10_LIBSERVER_COMMON_API void
 cleanupSocketRequestor() {
     if (requestor != NULL) {
         delete requestor;
diff --git a/src/lib/server_common/socket_request.h b/src/lib/server_common/socket_request.h
index f6ed58e..c8617c8 100644
--- a/src/lib/server_common/socket_request.h
+++ b/src/lib/server_common/socket_request.h
@@ -17,6 +17,7 @@
 
 #include <exceptions/exceptions.h>
 #include <util/noncopyable.h>
+#include <server_common/dll.h>
 
 #include <utility>
 #include <string>
@@ -43,7 +44,7 @@ namespace server_common {
 /// subclass when needed.
 ///
 /// \see socketRequestor function to access the object of this class.
-class SocketRequestor : isc::util::noncopyable {
+class B10_LIBSERVER_COMMON_API SocketRequestor : isc::util::noncopyable {
 protected:
     /// \brief Protected constructor
     ///
@@ -97,7 +98,7 @@ public:
     /// This is thrown if the other side doesn't want to comply to our
     /// requests, like when we ask for a socket already held by someone
     /// else or ask for nonsense (releasing a socket we don't own).
-    class SocketError : public Exception {
+    class B10_LIBSERVER_COMMON_API SocketError : public Exception {
     public:
         SocketError(const char* file, size_t line, const char* what) :
             Exception(file, line, what)
@@ -115,7 +116,7 @@ public:
     ///
     /// \see ShareError
     /// \see SocketAllocateError
-    class NonFatalSocketError : public SocketError {
+    class B10_LIBSERVER_COMMON_API NonFatalSocketError : public SocketError {
     public:
         NonFatalSocketError(const char* file, size_t line, const char* what) :
             SocketError(file, line, what)
@@ -129,7 +130,7 @@ public:
     /// allocated by bind10, but other bind10 module(s) is using it and
     /// the sharing parameters are incompatible (the socket can't be shared
     /// between the module and our module).
-    class ShareError : public NonFatalSocketError {
+    class B10_LIBSERVER_COMMON_API ShareError : public NonFatalSocketError {
     public:
         ShareError(const char* file, size_t line, const char* what) :
             NonFatalSocketError(file, line, what)
@@ -143,7 +144,8 @@ public:
     /// creator. This can happen when the address/port pair is already taken
     /// by a different application, the socket creator doesn't have enough
     /// privileges, or for some kind of similar reason.
-    class SocketAllocateError : public NonFatalSocketError {
+    class B10_LIBSERVER_COMMON_API SocketAllocateError :
+        public NonFatalSocketError {
     public:
         SocketAllocateError(const char* file, size_t line, const char* what) :
             NonFatalSocketError(file, line, what)
@@ -225,7 +227,7 @@ public:
 /// \return the active socket requestor object.
 /// \throw InvalidOperation if the object was not yet initialized.
 /// \see SocketRequestor::init to initialize the object.
-SocketRequestor& socketRequestor();
+B10_LIBSERVER_COMMON_API SocketRequestor& socketRequestor();
 
 /// \brief Initialize the singleton object
 ///
@@ -242,8 +244,9 @@ SocketRequestor& socketRequestor();
 ///                 to avoid them and provide the name of the application
 ///                 here.
 /// \throw InvalidOperation when it is called more than once
-void initSocketRequestor(cc::AbstractSession& session,
-                         const std::string& app_name);
+B10_LIBSERVER_COMMON_API void
+initSocketRequestor(cc::AbstractSession& session,
+                    const std::string& app_name);
 
 /// \brief Initialization for tests
 ///
@@ -260,7 +263,8 @@ void initSocketRequestor(cc::AbstractSession& session,
 /// \param requestor the object to be used. It can be NULL to reset to
 ///     an "virgin" state (which acts as if initTest or init was never
 ///     called before).
-void initTestSocketRequestor(SocketRequestor* requestor);
+B10_LIBSERVER_COMMON_API void
+initTestSocketRequestor(SocketRequestor* requestor);
 
 /// \brief Destroy the singleton instance
 ///
@@ -270,7 +274,7 @@ void initTestSocketRequestor(SocketRequestor* requestor);
 /// that want to be completely clean on exit.
 /// After this function has been called, all operations except init
 /// will fail.
-void cleanupSocketRequestor();
+B10_LIBSERVER_COMMON_API void cleanupSocketRequestor();
 
 }
 }
diff --git a/src/lib/statistics/Makefile.am b/src/lib/statistics/Makefile.am
index 206b527..b79ce9e 100644
--- a/src/lib/statistics/Makefile.am
+++ b/src/lib/statistics/Makefile.am
@@ -18,7 +18,7 @@ AM_CXXFLAGS += -Wno-unused-parameter
 endif
 
 lib_LTLIBRARIES = libb10-statistics.la
-libb10_statistics_la_SOURCES  = counter.h counter.cc
+libb10_statistics_la_SOURCES  = dll.h counter.h counter.cc
 libb10_statistics_la_SOURCES  += counter_dict.h counter_dict.cc
 
 CLEANFILES = *.gcno *.gcda
diff --git a/src/lib/statistics/counter.cc b/src/lib/statistics/counter.cc
index 9a781b4..a03c679 100644
--- a/src/lib/statistics/counter.cc
+++ b/src/lib/statistics/counter.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSTATISTICS_EXPORT
+
 #include <vector>
 
 #include <util/noncopyable.h>
diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h
index d276837..8a194fa 100644
--- a/src/lib/statistics/counter.h
+++ b/src/lib/statistics/counter.h
@@ -19,6 +19,7 @@
 
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
+#include <statistics/dll.h>
 
 namespace isc {
 namespace statistics {
@@ -26,7 +27,7 @@ namespace statistics {
 // forward declaration for pImpl idiom
 class CounterImpl;
 
-class Counter : isc::util::noncopyable {
+class B10_LIBSTATISTICS_API Counter : isc::util::noncopyable {
 private:
     boost::scoped_ptr<CounterImpl> impl_;
 public:
diff --git a/src/lib/statistics/counter_dict.cc b/src/lib/statistics/counter_dict.cc
index c56619b..9b5f230 100644
--- a/src/lib/statistics/counter_dict.cc
+++ b/src/lib/statistics/counter_dict.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBSTATISTICS_EXPORT
+
 #include <cassert>
 #include <stdexcept>
 #include <iterator>
@@ -215,20 +217,20 @@ CounterDictionary::end() const {
                CounterDictionaryConstIteratorImpl(impl_->end())));
 }
 
-CounterDictionary::ConstIterator::ConstIterator() :
+B10_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator() :
     impl_(new CounterDictionaryConstIteratorImpl())
 {}
 
-CounterDictionary::ConstIterator::~ConstIterator() {}
+B10_LIBSTATISTICS_API CounterDictionary::ConstIterator::~ConstIterator() {}
 
 // Copy constructor: deep copy of impl_
-CounterDictionary::ConstIterator::ConstIterator(
+B10_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator(
     const CounterDictionary::ConstIterator& source) :
     impl_(new CounterDictionaryConstIteratorImpl(*(source.impl_)))
 {}
 
 // Assignment operator: deep copy of impl_
-CounterDictionary::ConstIterator &
+B10_LIBSTATISTICS_API CounterDictionary::ConstIterator &
 CounterDictionary::ConstIterator::operator=(
     const CounterDictionary::ConstIterator &source)
 {
@@ -237,25 +239,25 @@ CounterDictionary::ConstIterator::operator=(
 }
 
 // The constructor from implementation detail
-CounterDictionary::ConstIterator::ConstIterator(
+B10_LIBSTATISTICS_API CounterDictionary::ConstIterator::ConstIterator(
     const CounterDictionaryConstIteratorImpl& source) :
     impl_(new CounterDictionaryConstIteratorImpl(source))
 {}
 
-const CounterDictionary::ConstIterator::value_type&
+B10_LIBSTATISTICS_API const CounterDictionary::ConstIterator::value_type&
 CounterDictionary::ConstIterator::dereference() const
 {
     return (impl_->dereference());
 }
 
-bool
+B10_LIBSTATISTICS_API bool
 CounterDictionary::ConstIterator::equal(
     CounterDictionary::ConstIterator const& other) const
 {
     return (impl_->equal(*(other.impl_)));
 }
 
-void
+B10_LIBSTATISTICS_API void
 CounterDictionary::ConstIterator::increment() {
     impl_->increment();
     return;
diff --git a/src/lib/statistics/counter_dict.h b/src/lib/statistics/counter_dict.h
index e38a45c..93204cd 100644
--- a/src/lib/statistics/counter_dict.h
+++ b/src/lib/statistics/counter_dict.h
@@ -23,6 +23,7 @@
 
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
+#include <statistics/dll.h>
 #include <statistics/counter.h>
 
 namespace isc {
@@ -31,7 +32,7 @@ namespace statistics {
 class CounterDictionaryImpl;
 class CounterDictionaryConstIteratorImpl;
 
-class CounterDictionary : isc::util::noncopyable {
+class B10_LIBSTATISTICS_API CounterDictionary : isc::util::noncopyable {
 private:
     boost::scoped_ptr<CounterDictionaryImpl> impl_;
     // Default constructor is forbidden; number of counter items must be
@@ -98,23 +99,24 @@ public:
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator();
+            B10_LIBSTATISTICS_API ConstIterator();
             /// The destructor.
             ///
             /// This method never throws an exception.
-            ~ConstIterator();
+            B10_LIBSTATISTICS_API ~ConstIterator();
             /// The assignment operator.
             ///
             /// This method is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator& operator=(const ConstIterator &source);
+            B10_LIBSTATISTICS_API ConstIterator&
+            operator=(const ConstIterator &source);
             /// The copy constructor.
             ///
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator(const ConstIterator& source);
+            B10_LIBSTATISTICS_API ConstIterator(const ConstIterator& source);
             /// The constructor from implementation detail.
             ///
             /// This method is used to create an instance of ConstIterator
@@ -123,15 +125,15 @@ public:
             /// This constructor is mostly exception free. But it may still
             /// throw a standard exception if memory allocation fails
             /// inside the method.
-            ConstIterator(
+            B10_LIBSTATISTICS_API ConstIterator(
                 const CounterDictionaryConstIteratorImpl& source);
         private:
             /// \brief An internal method to increment this iterator.
-            void increment();
+            B10_LIBSTATISTICS_API void increment();
             /// \brief An internal method to check equality.
-            bool equal(const ConstIterator& other) const;
+            B10_LIBSTATISTICS_API bool equal(const ConstIterator& other) const;
             /// \brief An internal method to dereference this iterator.
-            const value_type& dereference() const;
+            B10_LIBSTATISTICS_API const value_type& dereference() const;
         private:
             friend class boost::iterator_core_access;
     };
diff --git a/src/lib/statistics/dll.h b/src/lib/statistics/dll.h
new file mode 100644
index 0000000..c468d32
--- /dev/null
+++ b/src/lib/statistics/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBSTATISTICS_H
+#define __LIBSTATISTICS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBSTATISTICS_API
+#else
+#ifdef B10_LIBSTATISTICS_EXPORT
+#define B10_LIBSTATISTICS_API __declspec(dllexport)
+#else
+#define B10_LIBSTATISTICS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBSTATISTICS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/testutils/Makefile.am b/src/lib/testutils/Makefile.am
index 2281b6d..4d08eed 100644
--- a/src/lib/testutils/Makefile.am
+++ b/src/lib/testutils/Makefile.am
@@ -7,11 +7,12 @@ AM_CXXFLAGS=$(B10_CXXFLAGS)
 if HAVE_GTEST
 noinst_LTLIBRARIES = libb10-testutils.la
 
-libb10_testutils_la_SOURCES = srv_test.h srv_test.cc
+libb10_testutils_la_SOURCES = dll.h srv_test.h srv_test.cc
 libb10_testutils_la_SOURCES += dnsmessage_test.h dnsmessage_test.cc
+libb10_testutils_la_SOURCES += socket_request.h socket_request.cc
 libb10_testutils_la_SOURCES += mockups.h
 libb10_testutils_la_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 libb10_testutils_la_LIBADD = $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 endif
 
-EXTRA_DIST = portconfig.h socket_request.h
+EXTRA_DIST = portconfig.h
diff --git a/src/lib/testutils/dll.h b/src/lib/testutils/dll.h
new file mode 100644
index 0000000..c063207
--- /dev/null
+++ b/src/lib/testutils/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBTESTUTILS_H
+#define __LIBTESTUTILS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBTESTUTILS_API
+#else
+#ifdef B10_LIBTESTUTILS_EXPORT
+#define B10_LIBTESTUTILS_API __declspec(dllexport)
+#else
+#define B10_LIBTESTUTILS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBTESTUTILS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/testutils/dnsmessage_test.cc b/src/lib/testutils/dnsmessage_test.cc
index ec6914d..c72da6d 100644
--- a/src/lib/testutils/dnsmessage_test.cc
+++ b/src/lib/testutils/dnsmessage_test.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBTESTUTILS_EXPORT
+
 #include <dns/message.h>
 #include <dns/opcode.h>
 #include <dns/rdata.h>
@@ -33,13 +35,13 @@ using namespace isc::dns;
 
 namespace isc {
 namespace testutils {
-const unsigned int QR_FLAG = 0x1;
-const unsigned int AA_FLAG = 0x2;
-const unsigned int TC_FLAG = 0x4;
-const unsigned int RD_FLAG = 0x8;
-const unsigned int RA_FLAG = 0x10;
-const unsigned int AD_FLAG = 0x20;
-const unsigned int CD_FLAG = 0x40;
+B10_LIBTESTUTILS_API const unsigned int QR_FLAG = 0x1;
+B10_LIBTESTUTILS_API const unsigned int AA_FLAG = 0x2;
+B10_LIBTESTUTILS_API const unsigned int TC_FLAG = 0x4;
+B10_LIBTESTUTILS_API const unsigned int RD_FLAG = 0x8;
+B10_LIBTESTUTILS_API const unsigned int RA_FLAG = 0x10;
+B10_LIBTESTUTILS_API const unsigned int AD_FLAG = 0x20;
+B10_LIBTESTUTILS_API const unsigned int CD_FLAG = 0x40;
 
 void
 headerCheck(const Message& message, const qid_t qid, const Rcode& rcode,
diff --git a/src/lib/testutils/dnsmessage_test.h b/src/lib/testutils/dnsmessage_test.h
index 5b80d2e..8bee13e 100644
--- a/src/lib/testutils/dnsmessage_test.h
+++ b/src/lib/testutils/dnsmessage_test.h
@@ -30,6 +30,8 @@
 
 #include <util/nonassignable.h>
 
+#include <testutils/dll.h>
+
 #include <gtest/gtest.h>
 
 namespace isc {
@@ -42,13 +44,13 @@ namespace testutils {
 /// (The flag values is irrelevant to their wire-format values).
 /// The meaning of the flags should be obvious from the variable names.
 //@{
-extern const unsigned int QR_FLAG;
-extern const unsigned int AA_FLAG;
-extern const unsigned int TC_FLAG;
-extern const unsigned int RD_FLAG;
-extern const unsigned int RA_FLAG;
-extern const unsigned int AD_FLAG;
-extern const unsigned int CD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int QR_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int AA_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int TC_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int RD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int RA_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int AD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int CD_FLAG;
 //@}
 
 /// Set of unit tests to examine a DNS message header.
@@ -80,7 +82,7 @@ extern const unsigned int CD_FLAG;
 /// \param ancount The expected value of ANCOUNT
 /// \param nscount The expected value of NSCOUNT
 /// \param arcount The expected value of ARCOUNT
-void
+B10_LIBTESTUTILS_API void
 headerCheck(const isc::dns::Message& message, const isc::dns::qid_t qid,
             const isc::dns::Rcode& rcode,
             const uint16_t opcodeval, const unsigned int flags,
@@ -113,8 +115,9 @@ headerCheck(const isc::dns::Message& message, const isc::dns::qid_t qid,
 ///
 /// \param expected_rrset The expected RRset
 /// \param actual_rrset The RRset to be tested
-void rrsetCheck(isc::dns::ConstRRsetPtr expected_rrset,
-                isc::dns::ConstRRsetPtr actual_rrset);
+B10_LIBTESTUTILS_API void
+rrsetCheck(isc::dns::ConstRRsetPtr expected_rrset,
+           isc::dns::ConstRRsetPtr actual_rrset);
 
 /// The definitions in this name space are not supposed to be used publicly,
 /// but are given here because they are used in templated functions.
@@ -195,11 +198,10 @@ private:
 /// parameter normally doesn't have to be specified, but for an SOA RR it
 /// must be set to its owner name, due to the internal check of
 /// \c dns::masterLoad().
-isc::dns::RRsetPtr textToRRset(const std::string& text_rrset,
-                               const isc::dns::RRClass& rrclass =
-                               isc::dns::RRClass::IN(),
-                               const isc::dns::Name& origin =
-                               isc::dns::Name::ROOT_NAME());
+B10_LIBTESTUTILS_API isc::dns::RRsetPtr
+textToRRset(const std::string& text_rrset,
+            const isc::dns::RRClass& rrclass = isc::dns::RRClass::IN(),
+            const isc::dns::Name& origin = isc::dns::Name::ROOT_NAME());
 
 /// Set of unit tests to check if two sets of RRsets are identical.
 ///
diff --git a/src/lib/testutils/mockups.h b/src/lib/testutils/mockups.h
index b5def4b..00c603d 100644
--- a/src/lib/testutils/mockups.h
+++ b/src/lib/testutils/mockups.h
@@ -26,6 +26,8 @@
 
 #include <asiodns/asiodns.h>
 
+#include <testutils/dll.h>
+
 #include <utility>
 #include <vector>
 
@@ -35,7 +37,7 @@ namespace testutils {
 // A minimal mock configuration session.  Most the methods are
 // stubbed out, except for a very basic group_sendmsg() and
 // group_recvmsg().  hasQueuedMessages() always returns false.
-class MockSession : public isc::cc::AbstractSession {
+class B10_LIBTESTUTILS_API MockSession : public isc::cc::AbstractSession {
 public:
     MockSession() :
         // by default we return a simple "success" message.
@@ -106,7 +108,8 @@ private:
 
 // This mock object does nothing except for recording passed parameters
 // to addServerXXX methods so the test code subsequently checks the parameters.
-class MockDNSService : public isc::asiodns::DNSServiceBase {
+class B10_LIBTESTUTILS_API MockDNSService :
+    public isc::asiodns::DNSServiceBase {
 public:
     // A helper tuple of parameters passed to addServerUDPFromFD().
     struct UDPFdParams {
@@ -144,7 +147,7 @@ private:
 };
 
 // A nonoperative DNSServer object to be used in calls to processMessage().
-class MockServer : public isc::asiodns::DNSServer {
+class B10_LIBTESTUTILS_API MockServer : public isc::asiodns::DNSServer {
 public:
     MockServer() : done_(false) {}
     void operator()(asio::error_code, size_t) {}
@@ -156,7 +159,8 @@ private:
 };
 
 // Mock Xfrout client
-class MockXfroutClient : public isc::xfr::AbstractXfroutClient {
+class B10_LIBTESTUTILS_API MockXfroutClient :
+    public isc::xfr::AbstractXfroutClient {
 public:
     MockXfroutClient() :
         is_connected_(false), connect_ok_(true), send_ok_(true),
diff --git a/src/lib/testutils/portconfig.h b/src/lib/testutils/portconfig.h
index ce1bb39..71856a0 100644
--- a/src/lib/testutils/portconfig.h
+++ b/src/lib/testutils/portconfig.h
@@ -18,6 +18,7 @@
 #include <gtest/gtest.h>
 #include <cc/data.h>
 #include <server_common/portconfig.h>
+#include <testutils/dll.h>
 
 namespace isc {
 namespace testutils {
diff --git a/src/lib/testutils/socket_request.cc b/src/lib/testutils/socket_request.cc
new file mode 100644
index 0000000..5a3dc45
--- /dev/null
+++ b/src/lib/testutils/socket_request.cc
@@ -0,0 +1,31 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBTESTUTILS_EXPORT
+
+#include <config.h>
+
+#ifdef _WIN32
+#include <ws2tcpip.h>
+#endif
+
+#include <testutils/socket_request.h>
+
+// Instantiate class
+
+class B10_LIBTESTUTILS_API TestSocketRequestor;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/testutils/socket_request.h b/src/lib/testutils/socket_request.h
index 0ae15f3..be1dc0c 100644
--- a/src/lib/testutils/socket_request.h
+++ b/src/lib/testutils/socket_request.h
@@ -20,6 +20,8 @@
 
 #include <asiodns/asiodns.h>
 
+#include <testutils/dll.h>
+
 #include <gtest/gtest.h>
 #include <boost/lexical_cast.hpp>
 
@@ -43,7 +45,8 @@ namespace testutils {
 /// Some member variables are intentionally made public so that test cases
 /// can easily check the value of them.  We prefer convenience for tests over
 /// class integrity here.
-class TestSocketRequestor : public isc::server_common::SocketRequestor {
+class B10_LIBTESTUTILS_API TestSocketRequestor :
+    public isc::server_common::SocketRequestor {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/testutils/srv_test.cc b/src/lib/testutils/srv_test.cc
index d686da6..b2eb2fd 100644
--- a/src/lib/testutils/srv_test.cc
+++ b/src/lib/testutils/srv_test.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBTESTUTILS_EXPORT
+
 #include <config.h>
 
 #include <sys/types.h>
@@ -33,8 +35,8 @@ using namespace isc::asiolink;
 
 namespace isc {
 namespace testutils {
-const char* const DEFAULT_REMOTE_ADDRESS = "192.0.2.1";
-const uint16_t DEFAULT_REMOTE_PORT = 53210;
+const B10_LIBTESTUTILS_API char* const DEFAULT_REMOTE_ADDRESS = "192.0.2.1";
+const B10_LIBTESTUTILS_API uint16_t DEFAULT_REMOTE_PORT = 53210;
 
 SrvTestBase::SrvTestBase() : request_message(Message::RENDER),
                              parse_message(new Message(Message::PARSE)),
diff --git a/src/lib/testutils/srv_test.h b/src/lib/testutils/srv_test.h
index a5c516e..2ed9902 100644
--- a/src/lib/testutils/srv_test.h
+++ b/src/lib/testutils/srv_test.h
@@ -24,32 +24,33 @@
 #include <dns/rrclass.h>
 #include <dns/rrtype.h>
 
+#include <testutils/dll.h>
 #include "mockups.h"
 
 namespace asiolink {
-class IOSocket;
-class IOMessage;
-class IOEndpoint;
+class B10_LIBTESTUTILS_API IOSocket;
+class B10_LIBTESTUTILS_API IOMessage;
+class B10_LIBTESTUTILS_API IOEndpoint;
 }
 
 namespace isc {
 namespace testutils {
-extern const char* const DEFAULT_REMOTE_ADDRESS;
-extern const uint16_t DEFAULT_REMOTE_PORT;
+extern B10_LIBTESTUTILS_API const char* const DEFAULT_REMOTE_ADDRESS;
+extern B10_LIBTESTUTILS_API const uint16_t DEFAULT_REMOTE_PORT;
 
 // These are flags to indicate whether the corresponding flag bit of the
 // DNS header is to be set in the test cases.  (The flag values
 // is irrelevant to their wire-format values)
-extern const unsigned int QR_FLAG;
-extern const unsigned int AA_FLAG;
-extern const unsigned int TC_FLAG;
-extern const unsigned int RD_FLAG;
-extern const unsigned int RA_FLAG;
-extern const unsigned int AD_FLAG;
-extern const unsigned int CD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int QR_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int AA_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int TC_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int RD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int RA_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int AD_FLAG;
+extern B10_LIBTESTUTILS_API const unsigned int CD_FLAG;
 
 /// \brief The base class for Auth and Recurse test case
-class SrvTestBase : public ::testing::Test {
+class B10_LIBTESTUTILS_API SrvTestBase : public ::testing::Test {
 protected:
     SrvTestBase();
     virtual ~SrvTestBase();
diff --git a/src/lib/util/Makefile.am b/src/lib/util/Makefile.am
index c56e4b8..4612267 100644
--- a/src/lib/util/Makefile.am
+++ b/src/lib/util/Makefile.am
@@ -8,10 +8,12 @@ AM_CPPFLAGS += -DLOCKFILE_DIR=\"${localstatedir}/${PACKAGE_NAME}\"
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 lib_LTLIBRARIES = libb10-util.la
-libb10_util_la_SOURCES  = filename.h filename.cc
+libb10_util_la_SOURCES  = dll.h
+libb10_util_la_SOURCES += filename.h filename.cc
 libb10_util_la_SOURCES += locks.h lru_list.h
 libb10_util_la_SOURCES += strutil.h strutil.cc
-libb10_util_la_SOURCES += buffer.h io_utilities.h
+libb10_util_la_SOURCES += buffer.h buffer.cc
+libb10_util_la_SOURCES += io_utilities.h
 libb10_util_la_SOURCES += time_utilities.h time_utilities.cc
 libb10_util_la_SOURCES += interprocess_sync.h
 libb10_util_la_SOURCES += interprocess_sync_file.h interprocess_sync_file.cc
@@ -28,6 +30,7 @@ libb10_util_la_SOURCES += encode/binary_from_base32hex.h
 libb10_util_la_SOURCES += encode/binary_from_base16.h
 libb10_util_la_SOURCES += random/qid_gen.h random/qid_gen.cc
 libb10_util_la_SOURCES += random/random_number_generator.h
+libb10_util_la_SOURCES += random/random_number_generator.cc
 
 EXTRA_DIST = python/pycppwrapper_util.h
 
diff --git a/src/lib/util/buffer.cc b/src/lib/util/buffer.cc
new file mode 100644
index 0000000..fc23d05
--- /dev/null
+++ b/src/lib/util/buffer.cc
@@ -0,0 +1,26 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBUTIL_EXPORT
+
+#include <util/buffer.h>
+
+// Instantiate classes
+
+class B10_LIBUTIL_API InputBuffer;
+class B10_LIBUTIL_API OutputBuffer;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/util/buffer.h b/src/lib/util/buffer.h
index 7e88108..dc45143 100644
--- a/src/lib/util/buffer.h
+++ b/src/lib/util/buffer.h
@@ -23,6 +23,8 @@
 
 #include <exceptions/exceptions.h>
 
+#include <util/dll.h>
+
 #include <boost/shared_ptr.hpp>
 
 namespace isc {
@@ -32,7 +34,7 @@ namespace util {
 /// \brief A standard DNS module exception that is thrown if an out-of-range
 /// buffer operation is being performed.
 ///
-class InvalidBufferPosition : public Exception {
+class B10_LIBUTIL_API InvalidBufferPosition : public Exception {
 public:
     InvalidBufferPosition(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -86,7 +88,7 @@ public:
 /// head of the unread data.  An object of this class internally holds (a
 /// notion of) where the next read operation should start.  We call it the
 /// <em>read position</em> in this document.
-class InputBuffer {
+class B10_LIBUTIL_API InputBuffer {
 public:
     ///
     /// \name Constructors and Destructor
@@ -299,7 +301,7 @@ protected:
 /// if we really want that flexibility.  We may revisit the class design as
 /// we see more applications of the class.  The same considerations apply to
 /// the \c InputBuffer and \c MessageRenderer classes.
-class OutputBuffer {
+class B10_LIBUTIL_API OutputBuffer {
 public:
     ///
     /// \name Constructors and Destructor
diff --git a/src/lib/util/dll.h b/src/lib/util/dll.h
new file mode 100644
index 0000000..9b7c46d
--- /dev/null
+++ b/src/lib/util/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBUTIL_H
+#define __LIBUTIL_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBUTIL_API
+#else
+#ifdef B10_LIBUTIL_EXPORT
+#define B10_LIBUTIL_API __declspec(dllexport)
+#else
+#define B10_LIBUTIL_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBUTIL_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/util/encode/base16_from_binary.h b/src/lib/util/encode/base16_from_binary.h
index 29b4f59..a1c73a7 100644
--- a/src/lib/util/encode/base16_from_binary.h
+++ b/src/lib/util/encode/base16_from_binary.h
@@ -29,6 +29,7 @@ namespace std{
 // See base32hex_from_binary.h for why we need base64_from...hpp here.
 #include <boost/archive/iterators/base64_from_binary.hpp>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 namespace boost { 
diff --git a/src/lib/util/encode/base32hex.h b/src/lib/util/encode/base32hex.h
index d7129d7..fd49a25 100644
--- a/src/lib/util/encode/base32hex.h
+++ b/src/lib/util/encode/base32hex.h
@@ -19,6 +19,8 @@
 #include <string>
 #include <vector>
 
+#include <util/dll.h>
+
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
 // We should probably move this to somewhere else, possibly in some common
@@ -39,6 +41,7 @@ namespace encode {
 /// \param binary A vector object storing the data to be encoded. 
 /// \return A newly created string that stores base32hex encoded value for
 /// binary.
+B10_LIBUTIL_API
 std::string encodeBase32Hex(const std::vector<uint8_t>& binary);
 
 /// \brief Decode a text encoded in the base32hex format into the
@@ -51,6 +54,7 @@ std::string encodeBase32Hex(const std::vector<uint8_t>& binary);
 ///
 /// \param input A text encoded in the base32hex format.
 /// \param result A vector in which the decoded %data is to be stored.
+B10_LIBUTIL_API
 void decodeBase32Hex(const std::string& input, std::vector<uint8_t>& result);
 
 } // namespace encode 
diff --git a/src/lib/util/encode/base32hex_from_binary.h b/src/lib/util/encode/base32hex_from_binary.h
index 0d0472a..347d614 100644
--- a/src/lib/util/encode/base32hex_from_binary.h
+++ b/src/lib/util/encode/base32hex_from_binary.h
@@ -31,6 +31,7 @@ namespace std{
 // simply include the base64 header here.
 #include <boost/archive/iterators/base64_from_binary.hpp>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 namespace boost { 
diff --git a/src/lib/util/encode/base64.h b/src/lib/util/encode/base64.h
index 6b1b346..eace8e4 100644
--- a/src/lib/util/encode/base64.h
+++ b/src/lib/util/encode/base64.h
@@ -19,6 +19,8 @@
 #include <string>
 #include <vector>
 
+#include <util/dll.h>
+
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
 // We should probably move this to somewhere else, possibly in some common
@@ -42,6 +44,7 @@ namespace encode {
 ///
 /// \param binary A vector object storing the data to be encoded. 
 /// \return A newly created string that stores base64 encoded value for binary.
+B10_LIBUTIL_API
 std::string encodeBase64(const std::vector<uint8_t>& binary);
 
 /// \brief Decode a text encoded in the base64 format into the original %data.
@@ -66,6 +69,7 @@ std::string encodeBase64(const std::vector<uint8_t>& binary);
 ///
 /// \param input A text encoded in the base64 format.
 /// \param result A vector in which the decoded %data is to be stored.
+B10_LIBUTIL_API
 void decodeBase64(const std::string& input, std::vector<uint8_t>& result);
 
 } // namespace encode
diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc
index 23aed5b..13f2544 100644
--- a/src/lib/util/encode/base_n.cc
+++ b/src/lib/util/encode/base_n.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include <stdint.h>
 #include <cassert>
 #include <iterator>
@@ -389,32 +391,32 @@ typedef BaseNTransformer<4, '0', base16_encoder, base16_decoder>
 Base16Transformer;
 }
 
-string
+B10_LIBUTIL_API string
 encodeBase64(const vector<uint8_t>& binary) {
     return (Base64Transformer::encode(binary));
 }
 
-void
+B10_LIBUTIL_API void
 decodeBase64(const string& input, vector<uint8_t>& result) {
     Base64Transformer::decode("base64", input, result);
 }
 
-string
+B10_LIBUTIL_API string
 encodeBase32Hex(const vector<uint8_t>& binary) {
     return (Base32HexTransformer::encode(binary));
 }
 
-void
+B10_LIBUTIL_API void
 decodeBase32Hex(const string& input, vector<uint8_t>& result) {
     Base32HexTransformer::decode("base32hex", input, result);
 }
 
-string
+B10_LIBUTIL_API string
 encodeHex(const vector<uint8_t>& binary) {
     return (Base16Transformer::encode(binary));
 }
 
-void
+B10_LIBUTIL_API void
 decodeHex(const string& input, vector<uint8_t>& result) {
     Base16Transformer::decode("base16", input, result);
 }
diff --git a/src/lib/util/encode/binary_from_base16.h b/src/lib/util/encode/binary_from_base16.h
index 70d9661..2e8a089 100644
--- a/src/lib/util/encode/binary_from_base16.h
+++ b/src/lib/util/encode/binary_from_base16.h
@@ -21,6 +21,7 @@
 // See binary_from_base32hex.h for why we need _from_base64.hpp here.
 #include <boost/archive/iterators/binary_from_base64.hpp>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 #include <exceptions/exceptions.h>
diff --git a/src/lib/util/encode/binary_from_base32hex.h b/src/lib/util/encode/binary_from_base32hex.h
index f2c7edb..c752ac3 100644
--- a/src/lib/util/encode/binary_from_base32hex.h
+++ b/src/lib/util/encode/binary_from_base32hex.h
@@ -23,6 +23,7 @@
 // simply include the base64 header here.
 #include <boost/archive/iterators/binary_from_base64.hpp>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 #include <exceptions/exceptions.h>
diff --git a/src/lib/util/encode/hex.h b/src/lib/util/encode/hex.h
index 5c806fc..5e8937a 100644
--- a/src/lib/util/encode/hex.h
+++ b/src/lib/util/encode/hex.h
@@ -19,6 +19,8 @@
 #include <string>
 #include <vector>
 
+#include <util/dll.h>
+
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
 // We should probably move this to somewhere else, possibly in some common
@@ -39,6 +41,7 @@ namespace encode {
 /// \param binary A vector object storing the data to be encoded. 
 /// \return A newly created string that stores base16 encoded value for
 /// binary.
+B10_LIBUTIL_API
 std::string encodeHex(const std::vector<uint8_t>& binary);
 
 /// \brief Decode a text encoded in the base16 ('hex') format into the
@@ -52,6 +55,7 @@ std::string encodeHex(const std::vector<uint8_t>& binary);
 ///
 /// \param input A text encoded in the base16 format.
 /// \param result A vector in which the decoded %data is to be stored.
+B10_LIBUTIL_API
 void decodeHex(const std::string& input, std::vector<uint8_t>& result);
 
 } // namespace encode
diff --git a/src/lib/util/filename.cc b/src/lib/util/filename.cc
index d6951dc..22e5e8a 100644
--- a/src/lib/util/filename.cc
+++ b/src/lib/util/filename.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include <iostream>
 #include <algorithm>
 #include <string>
diff --git a/src/lib/util/filename.h b/src/lib/util/filename.h
index f625938..68a8b1c 100644
--- a/src/lib/util/filename.h
+++ b/src/lib/util/filename.h
@@ -17,6 +17,7 @@
 
 #include <string>
 
+#include <util/dll.h>
 #include <util/strutil.h>
 
 namespace isc {
@@ -55,7 +56,7 @@ namespace util {
 /// substituting components.
 
 
-class Filename {
+class B10_LIBUTIL_API Filename {
 public:
 
     /// \brief Constructor
@@ -70,7 +71,7 @@ public:
     /// \param name New name to replaced currently stored name
     void setName(const std::string& name) {
         full_name_ = isc::util::str::trim(name);
-#ifdef WIN32
+#ifdef _WIN32
         isc::util::str::normalizeSlash(full_name_);
 #endif
         split(full_name_, directory_, name_, extension_);
diff --git a/src/lib/util/hash/sha1.cc b/src/lib/util/hash/sha1.cc
index 091e293..37a338d 100644
--- a/src/lib/util/hash/sha1.cc
+++ b/src/lib/util/hash/sha1.cc
@@ -50,6 +50,9 @@
  *      without express or implied warranty of any kind.
  *      
  */
+
+#define B10_LIBUTIL_EXPORT
+
 #include <util/hash/sha1.h>
 
 namespace isc {
@@ -110,7 +113,7 @@ SHA1AddLength(SHA1Context *context, uint32_t length) {
  *      sha Error Code.
  *
  */
-int
+B10_LIBUTIL_API int
 SHA1Reset(SHA1Context *context) {
     if (!context) {
         return (SHA_NULL);
@@ -152,7 +155,7 @@ SHA1Reset(SHA1Context *context) {
  *      sha Error Code.
  *
  */
-int
+B10_LIBUTIL_API int
 SHA1Input(SHA1Context *context, const uint8_t *message_array, unsigned length) {
     if (!length) {
         return (SHA_SUCCESS);
@@ -206,8 +209,9 @@ SHA1Input(SHA1Context *context, const uint8_t *message_array, unsigned length) {
  * Returns:
  *   sha Error Code.
  */
-int SHA1FinalBits(SHA1Context *context, const uint8_t message_bits,
-                  unsigned int length)
+B10_LIBUTIL_API int
+SHA1FinalBits(SHA1Context *context, const uint8_t message_bits,
+              unsigned int length)
 {
     uint8_t masks[8] = {
         /* 0 0b00000000 */ 0x00,
@@ -273,7 +277,7 @@ int SHA1FinalBits(SHA1Context *context, const uint8_t message_bits,
  *      sha Error Code.
  *
  */
-int
+B10_LIBUTIL_API int
 SHA1Result(SHA1Context *context, uint8_t Message_Digest[SHA1_HASHSIZE]) {
     int i;
 
diff --git a/src/lib/util/hash/sha1.h b/src/lib/util/hash/sha1.h
index 6089ca8..49d77ea 100644
--- a/src/lib/util/hash/sha1.h
+++ b/src/lib/util/hash/sha1.h
@@ -35,6 +35,8 @@
 
 #include <stdint.h>
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 namespace hash {
@@ -64,7 +66,7 @@ enum {
  *  This structure will hold context information for the SHA-1
  *  hashing operation
  */
-typedef struct SHA1Context
+typedef struct B10_LIBUTIL_API SHA1Context
 {
     uint32_t Intermediate_Hash[SHA1_HASHSIZE/4]; /* Message Digest */
     uint32_t Length_Low;                /* Message length in bits */
@@ -78,12 +80,13 @@ typedef struct SHA1Context
 /*
  *  Function Prototypes
  */
-extern int SHA1Reset(SHA1Context *);
-extern int SHA1Input(SHA1Context *, const uint8_t *bytes,
-                     unsigned int bytecount);
-extern int SHA1FinalBits(SHA1Context *, const uint8_t bits,
-                         unsigned int bitcount);
-extern int SHA1Result(SHA1Context *, uint8_t Message_Digest[SHA1_HASHSIZE]);
+extern B10_LIBUTIL_API int SHA1Reset(SHA1Context *);
+extern B10_LIBUTIL_API int SHA1Input(SHA1Context *, const uint8_t *bytes,
+                                     unsigned int bytecount);
+extern B10_LIBUTIL_API int SHA1FinalBits(SHA1Context *, const uint8_t bits,
+                                         unsigned int bitcount);
+extern B10_LIBUTIL_API int SHA1Result(SHA1Context *,
+                                      uint8_t Message_Digest[SHA1_HASHSIZE]);
 
 } // namespace hash
 } // namespace util
diff --git a/src/lib/util/interprocess_sync.h b/src/lib/util/interprocess_sync.h
index b07f21b..ee2babb 100644
--- a/src/lib/util/interprocess_sync.h
+++ b/src/lib/util/interprocess_sync.h
@@ -17,12 +17,13 @@
 
 #include <string>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 namespace isc {
 namespace util {
 
-class InterprocessSyncLocker; // forward declaration
+class B10_LIBUTIL_API InterprocessSyncLocker; // forward declaration
 
 /// \brief Interprocess Sync Class
 ///
@@ -44,7 +45,7 @@ class InterprocessSyncLocker; // forward declaration
 /// NOTE: All implementations of InterprocessSync should keep the
 /// is_locked_ member variable updated whenever their
 /// lock()/tryLock()/unlock() implementations are called.
-class InterprocessSync : isc::util::nonassignable {
+class B10_LIBUTIL_API InterprocessSync : isc::util::nonassignable {
   // InterprocessSyncLocker is the only code outside this class that
   // should be allowed to call the lock(), tryLock() and unlock()
   // methods.
@@ -92,7 +93,7 @@ protected:
 /// locks that are released automatically when the block is exited
 /// (RAII). It is meant to be used along with InterprocessSync objects. See
 /// the description of InterprocessSync.
-class InterprocessSyncLocker : isc::util::nonassignable {
+class B10_LIBUTIL_API InterprocessSyncLocker : isc::util::nonassignable {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/util/interprocess_sync_file.cc b/src/lib/util/interprocess_sync_file.cc
index d045449..225c5ae 100644
--- a/src/lib/util/interprocess_sync_file.cc
+++ b/src/lib/util/interprocess_sync_file.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include "interprocess_sync_file.h"
 
 #include <string>
diff --git a/src/lib/util/interprocess_sync_file.h b/src/lib/util/interprocess_sync_file.h
index fd8da1b..a61696d 100644
--- a/src/lib/util/interprocess_sync_file.h
+++ b/src/lib/util/interprocess_sync_file.h
@@ -15,6 +15,7 @@
 #ifndef __INTERPROCESS_SYNC_FILE_H__
 #define __INTERPROCESS_SYNC_FILE_H__
 
+#include <util/dll.h>
 #include <util/interprocess_sync.h>
 #include <exceptions/exceptions.h>
 
@@ -25,7 +26,7 @@ namespace util {
 ///
 /// Exception that is thrown if it's not possible to open the
 /// lock file.
-class InterprocessSyncFileError : public Exception {
+class B10_LIBUTIL_API InterprocessSyncFileError : public Exception {
 public:
     InterprocessSyncFileError(const char* file, size_t line,
                               const char* what) :
@@ -46,7 +47,7 @@ public:
 /// This implementation opens lock files lazily (only when
 /// necessary). It also leaves the lock files lying around as multiple
 /// processes may have locks on them.
-class InterprocessSyncFile : public InterprocessSync {
+class B10_LIBUTIL_API InterprocessSyncFile : public InterprocessSync {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/util/interprocess_sync_null.cc b/src/lib/util/interprocess_sync_null.cc
index 5355d57..690304c 100644
--- a/src/lib/util/interprocess_sync_null.cc
+++ b/src/lib/util/interprocess_sync_null.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include "interprocess_sync_null.h"
 
 namespace isc {
diff --git a/src/lib/util/interprocess_sync_null.h b/src/lib/util/interprocess_sync_null.h
index 6ac0322..f6248ad 100644
--- a/src/lib/util/interprocess_sync_null.h
+++ b/src/lib/util/interprocess_sync_null.h
@@ -15,6 +15,7 @@
 #ifndef __INTERPROCESS_SYNC_NULL_H__
 #define __INTERPROCESS_SYNC_NULL_H__
 
+#include <util/dll.h>
 #include <util/interprocess_sync.h>
 
 namespace isc {
@@ -25,7 +26,7 @@ namespace util {
 /// This class specifies a concrete implementation for a null (no effect)
 /// interprocess synchronization mechanism. Please see the
 /// InterprocessSync class documentation for usage.
-class InterprocessSyncNull : public InterprocessSync {
+class B10_LIBUTIL_API InterprocessSyncNull : public InterprocessSync {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/util/io/Makefile.am b/src/lib/util/io/Makefile.am
index 1249178..cb4467d 100644
--- a/src/lib/util/io/Makefile.am
+++ b/src/lib/util/io/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 lib_LTLIBRARIES = libb10-util-io.la
-libb10_util_io_la_SOURCES = fd.h fd.cc fd_share.h fd_share.cc
+libb10_util_io_la_SOURCES = dll.h fd.h fd.cc fd_share.h fd_share.cc
 libb10_util_io_la_SOURCES += socketsession.h socketsession.cc sockaddr_util.h
 libb10_util_io_la_SOURCES += pktinfo_utilities.h
 libb10_util_io_la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
diff --git a/src/lib/util/io/dll.h b/src/lib/util/io/dll.h
new file mode 100644
index 0000000..2af1fed
--- /dev/null
+++ b/src/lib/util/io/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBUTIL_IO_H
+#define __LIBUTIL_IO_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBUTIL_IO_API
+#else
+#ifdef B10_LIBUTIL_IO_EXPORT
+#define B10_LIBUTIL_IO_API __declspec(dllexport)
+#else
+#define B10_LIBUTIL_IO_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBUTIL_IO_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/util/io/fd.cc b/src/lib/util/io/fd.cc
index 49aac39..1aeaa1d 100644
--- a/src/lib/util/io/fd.cc
+++ b/src/lib/util/io/fd.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_IO_EXPORT
+
 #include "fd.h"
 
 #include <unistd.h>
@@ -21,7 +23,7 @@ namespace isc {
 namespace util {
 namespace io {
 
-bool
+B10_LIBUTIL_IO_API bool
 write_data(const int fd, const void *buffer_v, const size_t length) {
     const unsigned char* buffer(static_cast<const unsigned char*>(buffer_v));
     size_t remaining = length;  // Amount remaining to be written
@@ -52,7 +54,7 @@ write_data(const int fd, const void *buffer_v, const size_t length) {
     return (true);
 }
 
-ssize_t
+B10_LIBUTIL_IO_API ssize_t
 read_data(const int fd, void *buffer_v, const size_t length) {
     unsigned char* buffer(static_cast<unsigned char*>(buffer_v));
     size_t remaining = length;   // Amount remaining to be read
diff --git a/src/lib/util/io/fd.h b/src/lib/util/io/fd.h
index bdd2d41..61ab1a3 100644
--- a/src/lib/util/io/fd.h
+++ b/src/lib/util/io/fd.h
@@ -17,6 +17,8 @@
 
 #include <unistd.h>
 
+#include <util/io/dll.h>
+
 /**
  * @file fd.h
  * @short Wrappers around common unix fd manipulation functions.
@@ -38,7 +40,7 @@ namespace io {
  * \param data The buffer to write.
  * \param length How much data is there to write.
  */
-bool
+B10_LIBUTIL_IO_API bool
 write_data(const int fd, const void *data, const size_t length);
 
 /*
@@ -51,7 +53,7 @@ write_data(const int fd, const void *data, const size_t length);
  * \param data Where to put the data.
  * \param length How many of them.
  */
-ssize_t
+B10_LIBUTIL_IO_API ssize_t
 read_data(const int fd, void *buffer, const size_t length);
 
 }
diff --git a/src/lib/util/io/fd_share.cc b/src/lib/util/io/fd_share.cc
index 7adbbbe..906b7c4 100644
--- a/src/lib/util/io/fd_share.cc
+++ b/src/lib/util/io/fd_share.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_IO_EXPORT
+
 #include <cstring>
 #include <cstdlib>
 
@@ -73,7 +75,7 @@ cmsg_space(const socklen_t len) {
 }
 }
 
-int
+B10_LIBUTIL_IO_API int
 recv_fd(const int sock) {
     struct msghdr msghdr;
     struct iovec iov_dummy;
@@ -124,7 +126,7 @@ recv_fd(const int sock) {
     return (new_fd);
 }
 
-int
+B10_LIBUTIL_IO_API int
 send_fd(const int sock, const int fd) {
     struct msghdr msghdr;
     struct iovec iov_dummy;
diff --git a/src/lib/util/io/fd_share.h b/src/lib/util/io/fd_share.h
index 2b30abd..8f6ac9e 100644
--- a/src/lib/util/io/fd_share.h
+++ b/src/lib/util/io/fd_share.h
@@ -15,6 +15,8 @@
 #ifndef FD_SHARE_H_
 #define FD_SHARE_H_
 
+#include <util/io/dll.h>
+
 /**
  * \file fd_share.h
  * \short Support to transfer file descriptors between processes.
@@ -41,7 +43,7 @@ const int FD_OTHER_ERROR = -1;
  * \param sock The unix domain socket to read from. Tested and it does
  *     not work with a pipe.
  */
-int recv_fd(const int sock);
+B10_LIBUTIL_IO_API int recv_fd(const int sock);
 
 /**
  * \short Sends a file descriptor.
@@ -56,7 +58,7 @@ int recv_fd(const int sock);
  * \param fd The file descriptor to send. It should work with any valid
  *     file descriptor.
  */
-int send_fd(const int sock, const int fd);
+B10_LIBUTIL_IO_API int send_fd(const int sock, const int fd);
 
 } // End for namespace io
 } // End for namespace util
diff --git a/src/lib/util/io/pktinfo_utilities.h b/src/lib/util/io/pktinfo_utilities.h
index 9883c30..7879ba1 100644
--- a/src/lib/util/io/pktinfo_utilities.h
+++ b/src/lib/util/io/pktinfo_utilities.h
@@ -18,6 +18,8 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 
+#include <util/io/dll.h>
+
 // These definitions in this file are for the convenience of internal
 // implementation and test code, and are not intended to be used publicly.
 // The namespace "internal" indicates the intent.
diff --git a/src/lib/util/io/sockaddr_util.h b/src/lib/util/io/sockaddr_util.h
index 0cd7c7b..4ca739f 100644
--- a/src/lib/util/io/sockaddr_util.h
+++ b/src/lib/util/io/sockaddr_util.h
@@ -21,6 +21,8 @@
 
 #include <cassert>
 
+#include <util/io/dll.h>
+
 // These definitions in this file are for the convenience of internal
 // implementation and test code, and are not intended to be used publicly.
 // The namespace "internal" indicates the intent.
diff --git a/src/lib/util/io/socketsession.cc b/src/lib/util/io/socketsession.cc
index d8aa936..f8437b6 100644
--- a/src/lib/util/io/socketsession.cc
+++ b/src/lib/util/io/socketsession.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_IO_EXPORT
+
 #include <config.h>
 
 #include <sys/types.h>
diff --git a/src/lib/util/io/socketsession.h b/src/lib/util/io/socketsession.h
index 3516d40..4ac7f39 100644
--- a/src/lib/util/io/socketsession.h
+++ b/src/lib/util/io/socketsession.h
@@ -15,6 +15,7 @@
 #ifndef __SOCKETSESSION_H_
 #define __SOCKETSESSION_H_ 1
 
+#include <util/io/dll.h>
 #include <util/noncopyable.h>
 #include <util/nonassignable.h>
 #include <exceptions/exceptions.h>
@@ -152,7 +153,7 @@ namespace io {
 /// In general the errors are unusual but possible failures such as unexpected
 /// connection reset, and suggest the application to close the connection and
 /// (if necessary) reestablish it.
-class SocketSessionError: public Exception {
+class B10_LIBUTIL_IO_API SocketSessionError : public Exception {
 public:
     SocketSessionError(const char *file, size_t line, const char *what):
         isc::Exception(file, line, what) {}
@@ -173,7 +174,7 @@ public:
 /// version of this base class, while it's not prohibited at the API level.
 ///
 /// See description of \c SocketSessionForwarder for the expected interface.
-class BaseSocketSessionForwarder  {
+class B10_LIBUTIL_IO_API BaseSocketSessionForwarder  {
 protected:
     BaseSocketSessionForwarder() {}
 
@@ -195,8 +196,8 @@ public:
 ///
 /// See the description of \ref SocketSessionUtility for other details of how
 /// the session forwarding works.
-class SocketSessionForwarder : isc::util::noncopyable,
-                               public BaseSocketSessionForwarder
+class B10_LIBUTIL_IO_API SocketSessionForwarder :
+    isc::util::noncopyable, public BaseSocketSessionForwarder
 {
 public:
     /// The constructor.
@@ -334,7 +335,7 @@ private:
 /// (e.g. a class or a function that constructs it) is responsible for validity
 /// of the data passed to the object.  See the description of
 /// \c SocketSessionReceiver::pop() for the specific case of that usage.
-class SocketSession : isc::util::nonassignable {
+class B10_LIBUTIL_IO_API SocketSession : isc::util::nonassignable {
 public:
     /// The constructor.
     ///
@@ -423,7 +424,7 @@ private:
 ///
 /// See the description of \ref SocketSessionUtility for other details of how
 /// the session forwarding works.
-class SocketSessionReceiver : isc::util::noncopyable {
+class B10_LIBUTIL_IO_API SocketSessionReceiver : isc::util::noncopyable {
 public:
     /// The constructor.
     ///
diff --git a/src/lib/util/io_utilities.h b/src/lib/util/io_utilities.h
index 61d4c9c..4904f5b 100644
--- a/src/lib/util/io_utilities.h
+++ b/src/lib/util/io_utilities.h
@@ -17,6 +17,8 @@
 
 #include <cstddef>
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 
diff --git a/src/lib/util/locks.h b/src/lib/util/locks.h
index da9e9cd..7d36a40 100644
--- a/src/lib/util/locks.h
+++ b/src/lib/util/locks.h
@@ -26,17 +26,19 @@
 #ifndef __LOCKS_
 #define __LOCKS_
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 namespace locks {
 
-class mutex {
+class B10_LIBUTIL_API mutex {
 };
 
-class recursive_mutex {
+class B10_LIBUTIL_API recursive_mutex {
 };
 
-class upgradable_mutex {
+class B10_LIBUTIL_API upgradable_mutex {
 };
 
 template <typename T>
diff --git a/src/lib/util/lru_list.h b/src/lib/util/lru_list.h
index 29b05dd..8f6a222 100644
--- a/src/lib/util/lru_list.h
+++ b/src/lib/util/lru_list.h
@@ -20,6 +20,7 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <util/dll.h>
 #include <util/locks.h>
 #include <util/noncopyable.h>
 
diff --git a/src/lib/util/memory_segment.h b/src/lib/util/memory_segment.h
index 97d2e02..ef51453 100644
--- a/src/lib/util/memory_segment.h
+++ b/src/lib/util/memory_segment.h
@@ -17,6 +17,8 @@
 
 #include <stdlib.h>
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 
@@ -26,7 +28,7 @@ namespace util {
 /// segments. This is an abstract class and a real
 /// implementation such as MemorySegmentLocal should be used
 /// in code.
-class MemorySegment {
+class B10_LIBUTIL_API MemorySegment {
 public:
     /// \brief Destructor
     virtual ~MemorySegment() {}
diff --git a/src/lib/util/memory_segment_local.cc b/src/lib/util/memory_segment_local.cc
index 9c345c9..a9e7dff 100644
--- a/src/lib/util/memory_segment_local.cc
+++ b/src/lib/util/memory_segment_local.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include "memory_segment_local.h"
 #include <exceptions/exceptions.h>
 
diff --git a/src/lib/util/memory_segment_local.h b/src/lib/util/memory_segment_local.h
index 5e43e53..f35f853 100644
--- a/src/lib/util/memory_segment_local.h
+++ b/src/lib/util/memory_segment_local.h
@@ -15,6 +15,7 @@
 #ifndef __MEMORY_SEGMENT_LOCAL_H__
 #define __MEMORY_SEGMENT_LOCAL_H__
 
+#include <util/dll.h>
 #include <util/memory_segment.h>
 
 namespace isc {
@@ -25,7 +26,7 @@ namespace util {
 /// This class specifies a concrete implementation for a malloc/free
 /// based MemorySegment. Please see the MemorySegment class
 /// documentation for usage.
-class MemorySegmentLocal : public MemorySegment {
+class B10_LIBUTIL_API MemorySegmentLocal : public MemorySegment {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/util/nonassignable.h b/src/lib/util/nonassignable.h
index c32fd4e..7dc707d 100644
--- a/src/lib/util/nonassignable.h
+++ b/src/lib/util/nonassignable.h
@@ -17,11 +17,13 @@
 #ifndef __NONASSIGNABLE_
 #define __NONASSIGNABLE_
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 namespace nonassignable_ {
 
-class nonassignable {
+class B10_LIBUTIL_API nonassignable {
 protected:
     nonassignable() {}
     ~nonassignable() {}
diff --git a/src/lib/util/noncopyable.h b/src/lib/util/noncopyable.h
index f819fc3..cbdfcd8 100644
--- a/src/lib/util/noncopyable.h
+++ b/src/lib/util/noncopyable.h
@@ -17,11 +17,13 @@
 #ifndef __NONCOPYABLE_
 #define __NONCOPYABLE_
 
+#include <util/dll.h>
+
 namespace isc {
 namespace util {
 namespace noncopyable_ {
 
-class noncopyable {
+class B10_LIBUTIL_API noncopyable {
 protected:
     noncopyable() {}
     ~noncopyable() {}
diff --git a/src/lib/util/python/pycppwrapper_util.h b/src/lib/util/python/pycppwrapper_util.h
index 462e715..4aa776c 100644
--- a/src/lib/util/python/pycppwrapper_util.h
+++ b/src/lib/util/python/pycppwrapper_util.h
@@ -19,6 +19,8 @@
 
 #include <exceptions/exceptions.h>
 
+#include <dns/python/dll.h>
+
 /**
  * @file pycppwrapper_util.h
  * @short Shared definitions for python/C(++) API
@@ -59,7 +61,7 @@ namespace python {
 
 /// This is thrown inside this utility when it finds a NULL pointer is passed
 /// when it should not be NULL.
-class PyCPPWrapperException : public isc::Exception {
+class B10_PYTHON_WRAPPER_API PyCPPWrapperException : public isc::Exception {
 public:
     PyCPPWrapperException(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
diff --git a/src/lib/util/pyunittests/pyunittests_util.cc b/src/lib/util/pyunittests/pyunittests_util.cc
index d266c84..2762dc7 100644
--- a/src/lib/util/pyunittests/pyunittests_util.cc
+++ b/src/lib/util/pyunittests/pyunittests_util.cc
@@ -16,11 +16,13 @@
 
 #include <stdint.h>
 
+#include <util/dll.h>
+
 // see util/time_utilities.h
 namespace isc {
 namespace util {
 namespace detail {
-extern int64_t (*gettimeFunction)();
+extern B10_LIBUTIL_API int64_t (*gettimeFunction)();
 }
 }
 }
diff --git a/src/lib/util/random/qid_gen.cc b/src/lib/util/random/qid_gen.cc
index 43041ad..b82512d 100644
--- a/src/lib/util/random/qid_gen.cc
+++ b/src/lib/util/random/qid_gen.cc
@@ -18,6 +18,8 @@
 // (and other parts where we need randomness, perhaps another thing
 // for a general libutil?)
 
+#define B10_LIBUTIL_EXPORT
+
 #include <util/random/qid_gen.h>
 
 #include <sys/time.h>
diff --git a/src/lib/util/random/qid_gen.h b/src/lib/util/random/qid_gen.h
index ed939e9..d081d06 100644
--- a/src/lib/util/random/qid_gen.h
+++ b/src/lib/util/random/qid_gen.h
@@ -25,6 +25,7 @@
 #include <boost/random/uniform_int.hpp>
 #include <boost/random/variate_generator.hpp>
 
+#include <util/dll.h>
 #include <util/nonassignable.h>
 
 namespace isc {
@@ -38,7 +39,7 @@ namespace random {
 ///
 /// It automatically seeds it with the current time when it is first
 /// used.
-class QidGenerator : isc::util::nonassignable {
+class B10_LIBUTIL_API QidGenerator : isc::util::nonassignable {
 public:
     /// \brief Returns the singleton instance of the QidGenerator
     ///
diff --git a/src/lib/util/random/random_number_generator.cc b/src/lib/util/random/random_number_generator.cc
new file mode 100644
index 0000000..6249931
--- /dev/null
+++ b/src/lib/util/random/random_number_generator.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#define B10_LIBUTIL_EXPORT
+
+#include <config.h>
+
+#include <time.h>
+
+#include <iterator>
+#include <vector>
+
+#include <util/random/random_number_generator.h>
+
+// Instantiate classes
+
+class B10_LIBUTIL_API UniformRandomIntegerGenerator;
+class B10_LIBUTIL_API WeightedRandomIntegerGenerator;
+
+// Local Variables:
+// mode: c++
+// End:
diff --git a/src/lib/util/random/random_number_generator.h b/src/lib/util/random/random_number_generator.h
index 3d2babd..8272dff 100644
--- a/src/lib/util/random/random_number_generator.h
+++ b/src/lib/util/random/random_number_generator.h
@@ -20,6 +20,7 @@
 #include <numeric>
 
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
 #include <util/noncopyable.h>
 #include <util/nonassignable.h>
 
@@ -32,19 +33,19 @@ namespace isc {
 namespace util {
 namespace random {
 
-class InvalidLimits : public isc::BadValue {
+class B10_LIBUTIL_API InvalidLimits : public isc::BadValue {
 public:
     InvalidLimits(const char* file, size_t line, const char* what) :
         isc::BadValue(file, line, what) {}
 };
 
-class SumNotOne : public isc::BadValue {
+class B10_LIBUTIL_API SumNotOne : public isc::BadValue {
 public:
     SumNotOne(const char* file, size_t line, const char* what) :
         isc::BadValue(file, line, what) {}
 };
 
-class InvalidProbValue : public isc::BadValue {
+class B10_LIBUTIL_API InvalidProbValue : public isc::BadValue {
 public:
     InvalidProbValue(const char* file, size_t line, const char* what) :
         isc::BadValue(file, line, what) {}
@@ -55,7 +56,7 @@ public:
 /// \brief Uniform random integer generator
 ///
 /// Generate uniformly distributed integers in range of [min, max]
-class UniformRandomIntegerGenerator : isc::util::noncopyable {
+class B10_LIBUTIL_API UniformRandomIntegerGenerator : isc::util::noncopyable {
 public:
     /// \brief Constructor
     ///
@@ -93,7 +94,8 @@ private:
 /// \brief Weighted random integer generator
 ///
 /// Generate random integers according different probabilities
-class WeightedRandomIntegerGenerator : isc::util::nonassignable {
+class B10_LIBUTIL_API WeightedRandomIntegerGenerator :
+    isc::util::nonassignable {
 public:
     /// \brief Constructor
     ///
diff --git a/src/lib/util/range_utilities.h b/src/lib/util/range_utilities.h
index 3f8b971..855e178 100644
--- a/src/lib/util/range_utilities.h
+++ b/src/lib/util/range_utilities.h
@@ -18,6 +18,8 @@
 #include <stdlib.h>
 #include <algorithm>
 
+#include <util/dll.h>
+
 // This header contains useful methods for conduction operations on
 // a range of container elements. Currently the collection is limited,
 // but it is expected to grow.
diff --git a/src/lib/util/strutil.cc b/src/lib/util/strutil.cc
index 8ed88cb..e623402 100644
--- a/src/lib/util/strutil.cc
+++ b/src/lib/util/strutil.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include <numeric>
 
 #include <string.h>
@@ -25,7 +27,7 @@ namespace str {
 
 // Normalize slashes
 
-void
+B10_LIBUTIL_API void
 normalizeSlash(std::string& name) {
     if (!name.empty()) {
         size_t pos = 0;
@@ -37,7 +39,7 @@ normalizeSlash(std::string& name) {
 
 // Trim String
 
-string
+B10_LIBUTIL_API string
 trim(const string& instring) {
     string retstring = "";
     if (!instring.empty()) {
@@ -61,7 +63,7 @@ trim(const string& instring) {
 // Tokenise string.  As noted in the header, this is locally written to avoid
 // another dependency on a Boost library.
 
-vector<string>
+B10_LIBUTIL_API vector<string>
 tokens(const std::string& text, const std::string& delim) {
     vector<string> result;
 
@@ -102,7 +104,7 @@ lengthSum(string::size_type curlen, const string& cur_string) {
 
 // Provide printf-style formatting.
 
-std::string
+B10_LIBUTIL_API std::string
 format(const std::string& format, const std::vector<std::string>& args) {
 
     static const string flag = "%s";
@@ -131,7 +133,7 @@ format(const std::string& format, const std::vector<std::string>& args) {
     return (result);
 }
 
-std::string
+B10_LIBUTIL_API std::string
 getToken(std::istringstream& iss) {
     string token;
     iss >> token;
diff --git a/src/lib/util/strutil.h b/src/lib/util/strutil.h
index 0dbbe96..1978206 100644
--- a/src/lib/util/strutil.h
+++ b/src/lib/util/strutil.h
@@ -21,6 +21,7 @@
 #include <sstream>
 #include <vector>
 #include <exceptions/exceptions.h>
+#include <util/dll.h>
 #include <boost/lexical_cast.hpp>
 
 namespace isc {
@@ -33,7 +34,7 @@ namespace str {
 /// \brief A standard string util exception that is thrown if getToken or
 /// numToToken are called with bad input data
 ///
-class StringTokenError : public Exception {
+class B10_LIBUTIL_API StringTokenError : public Exception {
 public:
     StringTokenError(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -47,7 +48,7 @@ public:
 /// if not the command line).
 ///
 /// \param name Name to be substituted
-void normalizeSlash(std::string& name);
+B10_LIBUTIL_API void normalizeSlash(std::string& name);
 
 
 /// \brief Trim Leading and Trailing Spaces
@@ -58,7 +59,7 @@ void normalizeSlash(std::string& name);
 /// \param instring Input string to modify
 ///
 /// \return String with leading and trailing spaces removed
-std::string trim(const std::string& instring);
+B10_LIBUTIL_API std::string trim(const std::string& instring);
 
 
 /// \brief Split String into Tokens
@@ -85,8 +86,9 @@ std::string trim(const std::string& instring);
 /// \param delim Delimiter characters
 ///
 /// \return Vector of tokens.
-std::vector<std::string> tokens(const std::string& text,
-        const std::string& delim = std::string(" \t\n"));
+B10_LIBUTIL_API std::vector<std::string>
+tokens(const std::string& text,
+       const std::string& delim = std::string(" \t\n"));
 
 
 /// \brief Uppercase Character
@@ -149,8 +151,8 @@ inline void lowercase(std::string& text) {
 /// \param args Vector of argument strings
 ///
 /// \return Resultant string
-std::string format(const std::string& format,
-    const std::vector<std::string>& args);
+B10_LIBUTIL_API std::string
+format(const std::string& format, const std::vector<std::string>& args);
 
 
 /// \brief Returns one token from the given stringstream
@@ -162,7 +164,7 @@ std::string format(const std::string& format,
 /// \param iss stringstream to read one token from
 ///
 /// \return the first token read from the stringstream
-std::string getToken(std::istringstream& iss);
+B10_LIBUTIL_API std::string getToken(std::istringstream& iss);
 
 /// \brief Converts a string token to an *unsigned* integer.
 ///
diff --git a/src/lib/util/time_utilities.cc b/src/lib/util/time_utilities.cc
index c756382..a0e2875 100644
--- a/src/lib/util/time_utilities.cc
+++ b/src/lib/util/time_utilities.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_EXPORT
+
 #include <stdint.h>
 
 #include <sys/time.h>
@@ -52,7 +54,7 @@ monthSecs(const int month, const int year) {
 namespace isc {
 namespace util {
 
-string
+B10_LIBUTIL_API string
 timeToText64(uint64_t value) {
     struct tm tm;
     unsigned int secs;
@@ -109,9 +111,9 @@ timeToText64(uint64_t value) {
 // intended for testing purposes, so, even if it's visible outside of this
 // library, it's not even declared in a header file.
 namespace detail {
-int64_t (*gettimeFunction)() = NULL;
+B10_LIBUTIL_API int64_t (*gettimeFunction)() = NULL;
 
-int64_t
+B10_LIBUTIL_API int64_t
 gettimeWrapper() {
     if (gettimeFunction != NULL) {
         return (gettimeFunction());
@@ -124,7 +126,7 @@ gettimeWrapper() {
 }
 }
 
-string
+B10_LIBUTIL_API string
 timeToText32(const uint32_t value) {
     // We first adjust the time to the closest epoch based on the current time.
     // Note that the following variables must be signed in order to handle
@@ -154,7 +156,7 @@ checkRange(const int min, const int max, const int value,
 }
 }
 
-uint64_t
+B10_LIBUTIL_API uint64_t
 timeFromText64(const string& time_txt) {
     // Confirm the source only consists digits.  sscanf() allows some
     // minor exceptions.
@@ -196,7 +198,7 @@ timeFromText64(const string& time_txt) {
     return (timeval);
 }
 
-uint32_t
+B10_LIBUTIL_API uint32_t
 timeFromText32(const string& time_txt) {
     // The implicit conversion from uint64_t to uint32_t should just work here,
     // because we only need to drop higher 32 bits.
diff --git a/src/lib/util/time_utilities.h b/src/lib/util/time_utilities.h
index a53089d..ea643fe 100644
--- a/src/lib/util/time_utilities.h
+++ b/src/lib/util/time_utilities.h
@@ -22,6 +22,8 @@
 
 #include <exceptions/exceptions.h>
 
+#include <util/dll.h>
+
 //
 // Note: this helper module isn't specific to the DNS protocol per se.
 // We should probably move this to somewhere else, possibly in some common
@@ -35,7 +37,7 @@ namespace util {
 /// \brief A standard DNS (or ISC) module exception that is thrown if 
 /// a time conversion function encounters bad input
 ///
-class InvalidTime : public Exception {
+class B10_LIBUTIL_API InvalidTime : public Exception {
 public:
     InvalidTime(const char* file, size_t line, const char* what) :
         isc::Exception(file, line, what) {}
@@ -64,7 +66,7 @@ namespace detail {
 /// If the implementation doesn't need to be tested with faked current time,
 /// it should simply use the system supplied library function instead of
 /// this one.
-int64_t gettimeWrapper();
+B10_LIBUTIL_API int64_t gettimeWrapper();
 }
 
 ///
@@ -112,7 +114,7 @@ int64_t gettimeWrapper();
 ///
 /// \param time_txt Textual time in the form of YYYYMMDDHHmmSS
 /// \return Seconds since epoch corresponding to \c time_txt
-uint64_t
+B10_LIBUTIL_API uint64_t
 timeFromText64(const std::string& time_txt);
 
 /// Convert textual DNSSEC time to integer, 32-bit version.
@@ -120,7 +122,7 @@ timeFromText64(const std::string& time_txt);
 /// This version is the same as \c timeFromText64() except that the return
 /// value is wrapped around to an unsigned 32-bit integer, simply dropping
 /// the upper 32 bits.
-uint32_t
+B10_LIBUTIL_API uint32_t
 timeFromText32(const std::string& time_txt);
 
 /// Convert integral DNSSEC time to textual form, 64-bit version.
@@ -137,7 +139,7 @@ timeFromText32(const std::string& time_txt);
 ///
 /// \param value Seconds since epoch to be converted.
 /// \return Textual representation of \c value in the form of YYYYMMDDHHmmSS.
-std::string
+B10_LIBUTIL_API std::string
 timeToText64(uint64_t value);
 
 /// Convert integral DNSSEC time to textual form, 32-bit version.
@@ -159,7 +161,7 @@ timeToText64(uint64_t value);
 /// half of the 32-bit values are treated as a future time.  For example,
 /// 2^32-1 (the highest value in 32-bit unsigned integers) will be converted
 /// to "21060207062815", instead of "19691231235959".
-std::string
+B10_LIBUTIL_API std::string
 timeToText32(const uint32_t value);
 
 //@}
diff --git a/src/lib/util/unittests/Makefile.am b/src/lib/util/unittests/Makefile.am
index 451ab4e..574c432 100644
--- a/src/lib/util/unittests/Makefile.am
+++ b/src/lib/util/unittests/Makefile.am
@@ -2,7 +2,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 noinst_LTLIBRARIES = libutil_unittests.la
-libutil_unittests_la_SOURCES = fork.h fork.cc resolver.h
+libutil_unittests_la_SOURCES = dll.h fork.h fork.cc resolver.h
 libutil_unittests_la_SOURCES += newhook.h newhook.cc
 libutil_unittests_la_SOURCES += testdata.h testdata.cc
 if HAVE_GTEST
diff --git a/src/lib/util/unittests/dll.h b/src/lib/util/unittests/dll.h
new file mode 100644
index 0000000..a3fa1a7
--- /dev/null
+++ b/src/lib/util/unittests/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBUTIL_UNITTESTS_H
+#define __LIBUTIL_UNITTESTS_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBUTIL_UNITTESTS_API
+#else
+#ifdef B10_LIBUTIL_UNITTESTS_EXPORT
+#define B10_LIBUTIL_UNITTESTS_API __declspec(dllexport)
+#else
+#define B10_LIBUTIL_UNITTESTS_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBUTIL_UNITTESTS_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/util/unittests/fork.cc b/src/lib/util/unittests/fork.cc
index 3414a3c..cb52b5a 100644
--- a/src/lib/util/unittests/fork.cc
+++ b/src/lib/util/unittests/fork.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include "fork.h"
 
 #include <util/io/fd.h>
@@ -38,7 +40,7 @@ namespace isc {
 namespace util {
 namespace unittests {
 
-bool
+B10_LIBUTIL_UNITTESTS_API bool
 process_ok(pid_t process) {
     // Create a timeout
     struct sigaction ignored, original;
@@ -69,7 +71,7 @@ process_ok(pid_t process) {
  * This creates a pipe, forks and feeds the pipe with given data.
  * Used to provide the input in non-blocking/asynchronous way.
  */
-pid_t
+B10_LIBUTIL_UNITTESTS_API pid_t
 provide_input(int *read_pipe, const void *input, const size_t length)
 {
     int pipes[2];
@@ -95,7 +97,7 @@ provide_input(int *read_pipe, const void *input, const size_t length)
  * This creates a pipe, forks and reads the pipe and compares it
  * with given data. Used to check output of run in asynchronous way.
  */
-pid_t
+B10_LIBUTIL_UNITTESTS_API pid_t
 check_output(int *write_pipe, const void *output, const size_t length)
 {
     int pipes[2];
diff --git a/src/lib/util/unittests/fork.h b/src/lib/util/unittests/fork.h
index 2d27a11..057cf30 100644
--- a/src/lib/util/unittests/fork.h
+++ b/src/lib/util/unittests/fork.h
@@ -17,6 +17,8 @@
 
 #include <unistd.h>
 
+#include <util/unittests/dll.h>
+
 /**
  * \file fork.h
  * \brief Help functions to fork the test case process.
@@ -36,13 +38,13 @@ namespace unittests {
  * @return True if the process terminates with 0, false otherwise.
  * @param process The ID of process to wait for.
  */
-bool
+B10_LIBUTIL_UNITTESTS_API bool
 process_ok(pid_t process);
 
-pid_t
+B10_LIBUTIL_UNITTESTS_API pid_t
 provide_input(int *read_pipe, const void *input, const size_t length);
 
-pid_t
+B10_LIBUTIL_UNITTESTS_API pid_t
 check_output(int *write_pipe, const void *output, const size_t length);
 
 } // End of the namespace
diff --git a/src/lib/util/unittests/newhook.cc b/src/lib/util/unittests/newhook.cc
index 9e545a5..b947735 100644
--- a/src/lib/util/unittests/newhook.cc
+++ b/src/lib/util/unittests/newhook.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include <stdlib.h>
 
 #include <new>
@@ -44,8 +46,8 @@ operator delete(void* p) throw() {
 namespace isc {
 namespace util {
 namespace unittests {
-bool force_throw_on_new = false;
-size_t throw_size_on_new = 0;
+B10_LIBUTIL_UNITTESTS_API bool force_throw_on_new = false;
+B10_LIBUTIL_UNITTESTS_API size_t throw_size_on_new = 0;
 }
 }
 }
diff --git a/src/lib/util/unittests/newhook.h b/src/lib/util/unittests/newhook.h
index c90751e..fe08ea2 100644
--- a/src/lib/util/unittests/newhook.h
+++ b/src/lib/util/unittests/newhook.h
@@ -15,6 +15,8 @@
 #ifndef __UTIL_UNITTESTS_NEWHOOK_H
 #define __UTIL_UNITTESTS_NEWHOOK_H 1
 
+#include <util/unittests/dll.h>
+
 /**
  * \file newhook.h
  * \brief Enable the use of special operator new that throws for testing.
@@ -57,7 +59,7 @@ namespace unittests {
 /// Switch to enable the use of special operator new
 ///
 /// This is set to \c false by default.
-extern bool force_throw_on_new;
+extern B10_LIBUTIL_UNITTESTS_API bool force_throw_on_new;
 
 /// The allocation size that triggers an exception in the special operator new
 ///
@@ -70,7 +72,7 @@ extern bool force_throw_on_new;
 /// The default value is 0.  The value of this variable has no meaning
 /// unless the use of the special operator is enabled at build time and
 /// via \c force_throw_on_new.
-extern size_t throw_size_on_new;
+extern B10_LIBUTIL_UNITTESTS_API size_t throw_size_on_new;
 }
 }
 }
diff --git a/src/lib/util/unittests/resource.cc b/src/lib/util/unittests/resource.cc
index 3e77e0d..2c3a9c6 100644
--- a/src/lib/util/unittests/resource.cc
+++ b/src/lib/util/unittests/resource.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include "resource.h"
 
 #include <gtest/gtest.h>
@@ -23,7 +25,7 @@ namespace isc {
 namespace util {
 namespace unittests {
 
-void
+B10_LIBUTIL_UNITTESTS_API void
 dontCreateCoreDumps() {
     const rlimit core_limit = {0, 0};
 
diff --git a/src/lib/util/unittests/resource.h b/src/lib/util/unittests/resource.h
index 6430ab2..360c693 100644
--- a/src/lib/util/unittests/resource.h
+++ b/src/lib/util/unittests/resource.h
@@ -15,6 +15,8 @@
 #ifndef __UTIL_UNITTESTS_RESOURCE_H
 #define __UTIL_UNITTESTS_RESOURCE_H 1
 
+#include <util/unittests/dll.h>
+
 namespace isc {
 namespace util {
 namespace unittests {
@@ -26,7 +28,7 @@ namespace unittests {
 /// is used, where processes abort (and create cores in the process).
 /// As a new process is forked to run EXPECT_DEATH tests, the rlimits of
 /// the parent process that runs the other tests should be unaffected.
-void dontCreateCoreDumps();
+B10_LIBUTIL_UNITTESTS_API void dontCreateCoreDumps();
 
 } // end of namespace unittests
 } // end of namespace util
diff --git a/src/lib/util/unittests/run_all.cc b/src/lib/util/unittests/run_all.cc
index 5f50f77..0851475 100644
--- a/src/lib/util/unittests/run_all.cc
+++ b/src/lib/util/unittests/run_all.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include <stdlib.h>
 
 #include <iostream>
@@ -25,7 +27,7 @@ namespace isc {
 namespace util {
 namespace unittests {
 
-int
+B10_LIBUTIL_UNITTESTS_API int
 run_all() {
     int ret = 0;
 
diff --git a/src/lib/util/unittests/run_all.h b/src/lib/util/unittests/run_all.h
index 94c7cb0..7eb0d51 100644
--- a/src/lib/util/unittests/run_all.h
+++ b/src/lib/util/unittests/run_all.h
@@ -21,6 +21,8 @@
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/dll.h>
+
 namespace isc {
 namespace util {
 namespace unittests {
@@ -41,7 +43,7 @@ namespace unittests {
 ///
 /// \return Return value from RUN_ALL_TESTS().
 
-int run_all();
+B10_LIBUTIL_UNITTESTS_API int run_all();
 
 } // namespace unittests
 } // namespace util
diff --git a/src/lib/util/unittests/testdata.cc b/src/lib/util/unittests/testdata.cc
index 2148d31..4205c63 100644
--- a/src/lib/util/unittests/testdata.cc
+++ b/src/lib/util/unittests/testdata.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include <string>
 #include <stdexcept>
 #include <fstream>
@@ -33,12 +35,12 @@ namespace isc {
 namespace util {
 namespace unittests {
 
-void
+B10_LIBUTIL_UNITTESTS_API void
 addTestDataPath(const string& path) {
     getDataPaths().push_back(path);
 }
 
-void
+B10_LIBUTIL_UNITTESTS_API void
 openTestData(const char* const datafile, ifstream& ifs) {
     vector<string>::const_iterator it = getDataPaths().begin();
     for (; it != getDataPaths().end(); ++it) {
diff --git a/src/lib/util/unittests/testdata.h b/src/lib/util/unittests/testdata.h
index a452dc6..8177f23 100644
--- a/src/lib/util/unittests/testdata.h
+++ b/src/lib/util/unittests/testdata.h
@@ -15,6 +15,8 @@
 #ifndef __UTIL_UNITTESTS_TESTDATA_H
 #define __UTIL_UNITTESTS_TESTDATA_H 1
 
+#include <util/unittests/dll.h>
+
 /**
  * \file testdata.h
  * \brief Manipulating test data files.
@@ -28,7 +30,7 @@ namespace util {
 namespace unittests {
 /// Add a path (directory) that \c openTestData() will search for test data
 /// files.
-void addTestDataPath(const std::string& path);
+B10_LIBUTIL_UNITTESTS_API void addTestDataPath(const std::string& path);
 
 /// Open a file specified by 'datafile' using the data paths registered via
 /// addTestDataPath().  On success, ifs will be ready for reading the data
@@ -42,6 +44,7 @@ void addTestDataPath(const std::string& path);
 /// is to use a different \c ifstream object for a new call to this function;
 /// alternatively make sure you explicitly clear the error bit by calling
 /// \c ifstream::clear() on \c ifs.
+B10_LIBUTIL_UNITTESTS_API
 void openTestData(const char* const datafile, std::ifstream& ifs);
 }
 }
diff --git a/src/lib/util/unittests/textdata.h b/src/lib/util/unittests/textdata.h
index 3e5fe0f..ea211e8 100644
--- a/src/lib/util/unittests/textdata.h
+++ b/src/lib/util/unittests/textdata.h
@@ -18,6 +18,8 @@
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/dll.h>
+
 #ifndef __UTIL_UNITTESTS_TEXTDATA_H
 #define __UTIL_UNITTESTS_TEXTDATA_H 1
 
diff --git a/src/lib/util/unittests/wiredata.cc b/src/lib/util/unittests/wiredata.cc
index f24176d..22c019f 100644
--- a/src/lib/util/unittests/wiredata.cc
+++ b/src/lib/util/unittests/wiredata.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBUTIL_UNITTESTS_EXPORT
+
 #include "wiredata.h"
 
 #include <gtest/gtest.h>
@@ -25,7 +27,7 @@ namespace isc {
 namespace util {
 namespace unittests {
 
-void
+B10_LIBUTIL_UNITTESTS_API void
 matchWireData(const void* expected_data, size_t expected_len,
               const void* actual_data, size_t actual_len)
 {
diff --git a/src/lib/util/unittests/wiredata.h b/src/lib/util/unittests/wiredata.h
index a33a03a..3f2314a 100644
--- a/src/lib/util/unittests/wiredata.h
+++ b/src/lib/util/unittests/wiredata.h
@@ -17,6 +17,8 @@
 
 #include <cstddef>
 
+#include <util/unittests/dll.h>
+
 /// \file wiredata.h
 /// \brief Utilities for tests with wire data.
 ///
@@ -32,8 +34,9 @@ namespace unittests {
 /// This method checks if the expected and actual data have the same length
 /// and all bytes are the same.  If not, it reports the point of mismatch in
 /// the google test format.
-void matchWireData(const void* expected_data, std::size_t expected_len,
-                   const void* actual_data, std::size_t actual_len);
+void B10_LIBUTIL_UNITTESTS_API
+matchWireData(const void* expected_data, std::size_t expected_len,
+              const void* actual_data, std::size_t actual_len);
 }
 }
 }
diff --git a/src/lib/xfr/Makefile.am b/src/lib/xfr/Makefile.am
index 5551a5b..a8ebbeb 100644
--- a/src/lib/xfr/Makefile.am
+++ b/src/lib/xfr/Makefile.am
@@ -13,5 +13,5 @@ endif
 CLEANFILES = *.gcno *.gcda
 
 lib_LTLIBRARIES = libb10-xfr.la
-libb10_xfr_la_SOURCES = xfrout_client.h xfrout_client.cc
+libb10_xfr_la_SOURCES = dll.h xfrout_client.h xfrout_client.cc
 libb10_xfr_la_LIBADD = $(top_builddir)/src/lib/util/io/libb10-util-io.la
diff --git a/src/lib/xfr/dll.h b/src/lib/xfr/dll.h
new file mode 100644
index 0000000..fae992e
--- /dev/null
+++ b/src/lib/xfr/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __LIBXFR_H
+#define __LIBXFR_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_LIBXFR_API
+#else
+#ifdef B10_LIBXFR_EXPORT
+#define B10_LIBXFR_API __declspec(dllexport)
+#else
+#define B10_LIBXFR_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __LIBXFR_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/src/lib/xfr/xfrout_client.cc b/src/lib/xfr/xfrout_client.cc
index af0c1b5..77e283b 100644
--- a/src/lib/xfr/xfrout_client.cc
+++ b/src/lib/xfr/xfrout_client.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_LIBXFR_EXPORT
+
 #include <cstdlib>
 #include <cstring>
 #include <iostream>
diff --git a/src/lib/xfr/xfrout_client.h b/src/lib/xfr/xfrout_client.h
index fa21a01..1a03206 100644
--- a/src/lib/xfr/xfrout_client.h
+++ b/src/lib/xfr/xfrout_client.h
@@ -23,12 +23,14 @@
 
 #include <exceptions/exceptions.h>
 
+#include <xfr/dll.h>
+
 namespace isc {
 namespace xfr {
 
 struct XfroutClientImpl;
 
-class XfroutError: public Exception {
+class B10_LIBXFR_API XfroutError: public Exception {
 public:
     XfroutError(const char *file, size_t line, const char *what):
         isc::Exception(file, line, what) {}
@@ -39,7 +41,7 @@ public:
 ///
 /// The intended primary usage of abstraction is to allow tests for the
 /// user class of XfroutClient without requiring actual communication.
-class AbstractXfroutClient : isc::util::noncopyable {
+class B10_LIBXFR_API AbstractXfroutClient : isc::util::noncopyable {
     ///
     /// \name Constructor and Destructor.
     ///
@@ -60,7 +62,7 @@ public:
                                       uint16_t msg_len) = 0;
 };
 
-class XfroutClient : public AbstractXfroutClient {
+class B10_LIBXFR_API XfroutClient : public AbstractXfroutClient {
 public:
     XfroutClient(const std::string& file);
     ~XfroutClient();
diff --git a/tests/tools/perfdhcp/Makefile.am b/tests/tools/perfdhcp/Makefile.am
index 7c8064e..2df6b60 100644
--- a/tests/tools/perfdhcp/Makefile.am
+++ b/tests/tools/perfdhcp/Makefile.am
@@ -19,7 +19,8 @@ AM_LDFLAGS += -static
 endif
 
 lib_LTLIBRARIES = libb10_perfdhcp++.la
-libb10_perfdhcp___la_SOURCES = command_options.cc command_options.h
+libb10_perfdhcp___la_SOURCES  = dll.h
+libb10_perfdhcp___la_SOURCES += command_options.cc command_options.h
 libb10_perfdhcp___la_SOURCES += localized_option.h
 libb10_perfdhcp___la_SOURCES += perf_pkt6.cc perf_pkt6.h
 libb10_perfdhcp___la_SOURCES += perf_pkt4.cc perf_pkt4.h
diff --git a/tests/tools/perfdhcp/command_options.cc b/tests/tools/perfdhcp/command_options.cc
index 09393bb..60649fc 100644
--- a/tests/tools/perfdhcp/command_options.cc
+++ b/tests/tools/perfdhcp/command_options.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_PERFDHCP_EXPORT
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
diff --git a/tests/tools/perfdhcp/command_options.h b/tests/tools/perfdhcp/command_options.h
index a001ef4..99c1379 100644
--- a/tests/tools/perfdhcp/command_options.h
+++ b/tests/tools/perfdhcp/command_options.h
@@ -20,6 +20,8 @@
 
 #include <util/noncopyable.h>
 
+#include "dll.h"
+
 namespace isc {
 namespace perfdhcp {
 
@@ -28,7 +30,7 @@ namespace perfdhcp {
 /// This class is responsible for parsing the command-line and storing the
 /// specified options.
 ///
-class CommandOptions : public isc::util::noncopyable {
+class B10_PERFDHCP_API CommandOptions : public isc::util::noncopyable {
 public:
     /// 2-way (cmd line param -i) or 4-way exchanges
     enum ExchangeMode {
diff --git a/tests/tools/perfdhcp/dll.h b/tests/tools/perfdhcp/dll.h
new file mode 100644
index 0000000..905f153
--- /dev/null
+++ b/tests/tools/perfdhcp/dll.h
@@ -0,0 +1,32 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __PERFDHCP_H
+#define __PERFDHCP_H 1
+
+#if !defined(_WIN32) || defined(USE_STATIC_LINK)
+#define B10_PERFDHCP_API
+#else
+#ifdef B10_PERFDHCP_EXPORT
+#define B10_PERFDHCP_API __declspec(dllexport)
+#else
+#define B10_PERFDHCP_API __declspec(dllimport)
+#endif
+#endif
+
+#endif // __PERFDHCP_H
+
+// Local Variables: 
+// mode: c++
+// End: 
diff --git a/tests/tools/perfdhcp/localized_option.h b/tests/tools/perfdhcp/localized_option.h
index 5374684..fe8873b 100644
--- a/tests/tools/perfdhcp/localized_option.h
+++ b/tests/tools/perfdhcp/localized_option.h
@@ -17,6 +17,8 @@
 
 #include <dhcp/pkt6.h>
 
+#include "dll.h"
+
 namespace isc {
 namespace perfdhcp {
 
@@ -40,7 +42,7 @@ namespace perfdhcp {
 /// of packet and store them in options' buffers.
 /// (\see perfdhcp::PerfPkt6::rawUnpack).
 ///
-class LocalizedOption : public dhcp::Option {
+class B10_PERFDHCP_API LocalizedOption : public dhcp::Option {
 public:
     /// \brief Constructor, sets default (0) option offset
     ///
diff --git a/tests/tools/perfdhcp/perf_pkt4.cc b/tests/tools/perfdhcp/perf_pkt4.cc
index 3f733af..fadf1a7 100644
--- a/tests/tools/perfdhcp/perf_pkt4.cc
+++ b/tests/tools/perfdhcp/perf_pkt4.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_PERFDHCP_EXPORT
+
 #include <dhcp/libdhcp++.h>
 #include <dhcp/dhcp6.h>
 
diff --git a/tests/tools/perfdhcp/perf_pkt4.h b/tests/tools/perfdhcp/perf_pkt4.h
index f4cc440..1d993ef 100644
--- a/tests/tools/perfdhcp/perf_pkt4.h
+++ b/tests/tools/perfdhcp/perf_pkt4.h
@@ -19,6 +19,7 @@
 #include <boost/shared_ptr.hpp>
 #include <dhcp/pkt4.h>
 
+#include "dll.h"
 #include "localized_option.h"
 
 namespace isc {
@@ -44,7 +45,7 @@ namespace perfdhcp {
 /// \note If you don't use template files simply use constructors
 /// inherited from parent class and isc::dhcp::Option type instead
 
-class PerfPkt4 : public dhcp::Pkt4 {
+class B10_PERFDHCP_API PerfPkt4 : public dhcp::Pkt4 {
 public:
 
     /// Localized option pointer type.
diff --git a/tests/tools/perfdhcp/perf_pkt6.cc b/tests/tools/perfdhcp/perf_pkt6.cc
index 24cfb93..eb78578 100644
--- a/tests/tools/perfdhcp/perf_pkt6.cc
+++ b/tests/tools/perfdhcp/perf_pkt6.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_PERFDHCP_EXPORT
+
 #include <iostream>
 #include <exceptions/exceptions.h>
 #include <dhcp/libdhcp++.h>
diff --git a/tests/tools/perfdhcp/perf_pkt6.h b/tests/tools/perfdhcp/perf_pkt6.h
index 94fe47b..07d61ad 100644
--- a/tests/tools/perfdhcp/perf_pkt6.h
+++ b/tests/tools/perfdhcp/perf_pkt6.h
@@ -19,6 +19,7 @@
 #include <boost/shared_ptr.hpp>
 #include <dhcp/pkt6.h>
 
+#include "dll.h"
 #include "localized_option.h"
 
 namespace isc {
@@ -44,7 +45,7 @@ namespace perfdhcp {
 /// \note If you don't use template files, simply use constructors
 /// inherited from parent class and the \ref isc::dhcp::Option type instead.
 
-class PerfPkt6 : public dhcp::Pkt6 {
+class B10_PERFDHCP_API PerfPkt6 : public dhcp::Pkt6 {
 public:
 
     /// Localized option pointer type.
diff --git a/tests/tools/perfdhcp/pkt_transform.cc b/tests/tools/perfdhcp/pkt_transform.cc
index 5ed39bf..dec4740 100644
--- a/tests/tools/perfdhcp/pkt_transform.cc
+++ b/tests/tools/perfdhcp/pkt_transform.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#define B10_PERFDHCP_EXPORT
+
 #include <iostream>
 
 #include <exceptions/exceptions.h>
diff --git a/tests/tools/perfdhcp/pkt_transform.h b/tests/tools/perfdhcp/pkt_transform.h
index 7fb19f4..1140e5a 100644
--- a/tests/tools/perfdhcp/pkt_transform.h
+++ b/tests/tools/perfdhcp/pkt_transform.h
@@ -17,6 +17,7 @@
 
 #include <dhcp/option.h>
 
+#include "dll.h"
 #include "localized_option.h"
 
 namespace isc {
diff --git a/tests/tools/perfdhcp/stats_mgr.h b/tests/tools/perfdhcp/stats_mgr.h
index 87f530e..965eb5c 100644
--- a/tests/tools/perfdhcp/stats_mgr.h
+++ b/tests/tools/perfdhcp/stats_mgr.h
@@ -29,6 +29,8 @@
 #include <util/noncopyable.h>
 #include <exceptions/exceptions.h>
 
+#include "dll.h"
+
 namespace isc {
 namespace perfdhcp {
 



More information about the bind10-changes mailing list