Index: KDE-ICE/globals.h
===================================================================
--- KDE-ICE/globals.h	(revision 471108)
+++ KDE-ICE/globals.h	(working copy)
@@ -33,9 +33,11 @@
 #include "KDE-ICE/ICElibint.h"
 #include "KDE-ICE/ICEutil.h"
 
+#include "KDE-ICE.h"
+
 #define _IceDefaultErrorHandler _kde_IceDefaultErrorHandler
 
-extern void _IceDefaultErrorHandler (
+KDEICE_EXPORT void _IceDefaultErrorHandler (
 #if NeedFunctionPrototypes
     IceConn         /* iceConn */,
     Bool            /* swap */,
@@ -49,7 +51,7 @@
 
 #define _IceDefaultIOErrorHandler _kde_IceDefaultIOErrorHandler
 
-extern void _IceDefaultIOErrorHandler (
+KDEICE_EXPORT void _IceDefaultIOErrorHandler (
 #if NeedFunctionPrototypes
     IceConn 		/* iceConn */
 #endif
@@ -57,7 +59,7 @@
 
 #define _IcePoMagicCookie1Proc _kde_IcePoMagicCookie1Proc
 
-extern IcePoAuthStatus _IcePoMagicCookie1Proc (
+KDEICE_EXPORT IcePoAuthStatus _IcePoMagicCookie1Proc (
 #if NeedFunctionPrototypes
     IceConn         /* iceConn */,
     IcePointer *    /* authStatePtr */,
@@ -73,7 +75,7 @@
 
 #define _IcePaMagicCookie1Proc _kde_IcePaMagicCookie1Proc
 
-extern IcePaAuthStatus _IcePaMagicCookie1Proc (
+KDEICE_EXPORT IcePaAuthStatus _IcePaMagicCookie1Proc (
 #if NeedFunctionPrototypes
     IceConn         /* iceConn */,
     IcePointer *    /* authStatePtr */,
@@ -88,7 +90,7 @@
 
 #define _IceProcessCoreMessage _kde_IceProcessCoreMessage
 
-extern void _IceProcessCoreMessage (
+KDEICE_EXPORT void _IceProcessCoreMessage (
 #if NeedFunctionPrototypes
     IceConn          /* iceConn */,
     int              /* opcode */,
Index: KDE-ICE/ICElib.h
===================================================================
--- KDE-ICE/ICElib.h	(revision 471108)
+++ KDE-ICE/ICElib.h	(working copy)
@@ -39,6 +39,8 @@
 #define SIZEOF(x) _SIZEOF(x)
 #endif
 
+#include "KDE-ICE.h"
+
 #define Bool int
 #define Status int
 #define True 1
@@ -250,7 +252,7 @@
 
 #define IceRegisterForProtocolSetup KDE_IceRegisterForProtocolSetup
 
-extern int IceRegisterForProtocolSetup (
+KDEICE_EXPORT int IceRegisterForProtocolSetup (
 #if NeedFunctionPrototypes
     char *			/* protocolName */,
     char *			/* vendor */,
@@ -266,7 +268,7 @@
 
 #define IceRegisterForProtocolReply KDE_IceRegisterForProtocolReply
 
-extern int IceRegisterForProtocolReply (
+KDEICE_EXPORT int IceRegisterForProtocolReply (
 #if NeedFunctionPrototypes
     char *			/* protocolName */,
     char *			/* vendor */,
@@ -285,7 +287,7 @@
 
 #define IceOpenConnection KDE_IceOpenConnection
 
-extern IceConn IceOpenConnection (
+KDEICE_EXPORT IceConn IceOpenConnection (
 #if NeedFunctionPrototypes
     char *		/* networkIdsList */,
     IcePointer		/* context */,
@@ -298,7 +300,7 @@
 
 #define IceGetConnectionContext KDE_IceGetConnectionContext
 
-extern IcePointer IceGetConnectionContext (
+KDEICE_EXPORT IcePointer IceGetConnectionContext (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -306,7 +308,7 @@
 
 #define IceListenForConnections KDE_IceListenForConnections
 
-extern Status IceListenForConnections (
+KDEICE_EXPORT Status IceListenForConnections (
 #if NeedFunctionPrototypes
     int *		/* countRet */,
     IceListenObj **	/* listenObjsRet */,
@@ -317,7 +319,7 @@
 
 #define IceListenForWellKnownConnections KDE_IceListenForWellKnownConnections
 
-extern Status IceListenForWellKnownConnections (
+KDEICE_EXPORT Status IceListenForWellKnownConnections (
 #if NeedFunctionPrototypes
     char *		/* port */,
     int *		/* countRet */,
@@ -329,7 +331,7 @@
 
 #define IceGetListenConnectionNumber KDE_IceGetListenConnectionNumber
 
-extern int IceGetListenConnectionNumber (
+KDEICE_EXPORT int IceGetListenConnectionNumber (
 #if NeedFunctionPrototypes
     IceListenObj	/* listenObj */
 #endif
@@ -337,7 +339,7 @@
 
 #define IceGetListenConnectionString KDE_IceGetListenConnectionString
 
-extern char *IceGetListenConnectionString (
+KDEICE_EXPORT char *IceGetListenConnectionString (
 #if NeedFunctionPrototypes
     IceListenObj	/* listenObj */
 #endif
@@ -345,7 +347,7 @@
 
 #define IceComposeNetworkIdList KDE_IceComposeNetworkIdList
 
-extern char *IceComposeNetworkIdList (
+KDEICE_EXPORT char *IceComposeNetworkIdList (
 #if NeedFunctionPrototypes
     int			/* count */,
     IceListenObj *	/* listenObjs */
@@ -354,7 +356,7 @@
 
 #define IceFreeListenObjs KDE_IceFreeListenObjs
 
-extern void IceFreeListenObjs (
+KDEICE_EXPORT void IceFreeListenObjs (
 #if NeedFunctionPrototypes
     int			/* count */,
     IceListenObj *	/* listenObjs */
@@ -363,7 +365,7 @@
 
 #define IceSetHostBasedAuthProc KDE_IceSetHostBasedAuthProc
 
-extern void IceSetHostBasedAuthProc (
+KDEICE_EXPORT void IceSetHostBasedAuthProc (
 #if NeedFunctionPrototypes
     IceListenObj		/* listenObj */,
     IceHostBasedAuthProc   	/* hostBasedAuthProc */
@@ -372,7 +374,7 @@
 
 #define IceAcceptConnection KDE_IceAcceptConnection
 
-extern IceConn IceAcceptConnection (
+KDEICE_EXPORT IceConn IceAcceptConnection (
 #if NeedFunctionPrototypes
     IceListenObj	/* listenObj */,
     IceAcceptStatus *	/* statusRet */
@@ -381,7 +383,7 @@
 
 #define IceSetShutdownNegotiation KDE_IceSetShutdownNegotiation
 
-extern void IceSetShutdownNegotiation (
+KDEICE_EXPORT void IceSetShutdownNegotiation (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     Bool		/* negotiate */
@@ -390,7 +392,7 @@
 
 #define IceCheckShutdownNegotiation KDE_IceCheckShutdownNegotiation
 
-extern Bool IceCheckShutdownNegotiation (
+KDEICE_EXPORT Bool IceCheckShutdownNegotiation (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -398,7 +400,7 @@
 
 #define IceCloseConnection KDE_IceCloseConnection
 
-extern IceCloseStatus IceCloseConnection (
+KDEICE_EXPORT IceCloseStatus IceCloseConnection (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -406,7 +408,7 @@
 
 #define IceAddConnectionWatch KDE_IceAddConnectionWatch
 
-extern Status IceAddConnectionWatch (
+KDEICE_EXPORT Status IceAddConnectionWatch (
 #if NeedFunctionPrototypes
     IceWatchProc		/* watchProc */,
     IcePointer			/* clientData */
@@ -415,7 +417,7 @@
 
 #define IceRemoveConnectionWatch KDE_IceRemoveConnectionWatch
 
-extern void IceRemoveConnectionWatch (
+KDEICE_EXPORT void IceRemoveConnectionWatch (
 #if NeedFunctionPrototypes
     IceWatchProc		/* watchProc */,
     IcePointer			/* clientData */
@@ -424,7 +426,7 @@
 
 #define IceProtocolSetup KDE_IceProtocolSetup
 
-extern IceProtocolSetupStatus IceProtocolSetup (
+KDEICE_EXPORT IceProtocolSetupStatus IceProtocolSetup (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int 		/* myOpcode */,
@@ -441,7 +443,7 @@
 
 #define IceProtocolShutdown KDE_IceProtocolShutdown
 
-extern Status IceProtocolShutdown (
+KDEICE_EXPORT Status IceProtocolShutdown (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int			/* majorOpcode */
@@ -450,7 +452,7 @@
 
 #define IceProcessMessages KDE_IceProcessMessages
 
-extern IceProcessMessagesStatus IceProcessMessages (
+KDEICE_EXPORT IceProcessMessagesStatus IceProcessMessages (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     IceReplyWaitInfo *	/* replyWait */,
@@ -460,7 +462,7 @@
 
 #define IcePing KDE_IcePing
 
-extern Status IcePing (
+KDEICE_EXPORT Status IcePing (
 #if NeedFunctionPrototypes
    IceConn		/* iceConn */,
    IcePingReplyProc	/* pingReplyProc */,
@@ -470,7 +472,7 @@
 
 #define IceAllocScratch KDE_IceAllocScratch
 
-extern char *IceAllocScratch (
+KDEICE_EXPORT char *IceAllocScratch (
 #if NeedFunctionPrototypes
    IceConn		/* iceConn */,
    unsigned long	/* size */
@@ -479,7 +481,7 @@
 
 #define IceFlush KDE_IceFlush
 
-extern void IceFlush (
+KDEICE_EXPORT void IceFlush (
 #if NeedFunctionPrototypes
    IceConn		/* iceConn */
 #endif
@@ -487,7 +489,7 @@
 
 #define IceGetOutBufSize KDE_IceGetOutBufSize
 
-extern int IceGetOutBufSize (
+KDEICE_EXPORT int IceGetOutBufSize (
 #if NeedFunctionPrototypes
    IceConn		/* iceConn */
 #endif
@@ -495,7 +497,7 @@
 
 #define IceGetInBufSize KDE_IceGetInBufSize
 
-extern int IceGetInBufSize (
+KDEICE_EXPORT int IceGetInBufSize (
 #if NeedFunctionPrototypes
    IceConn		/* iceConn */
 #endif
@@ -503,7 +505,7 @@
 
 #define IceConnectionStatus KDE_IceConnectionStatus
 
-extern IceConnectStatus IceConnectionStatus (
+KDEICE_EXPORT IceConnectStatus IceConnectionStatus (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -511,7 +513,7 @@
 
 #define IceVendor KDE_IceVendor
 
-extern char *IceVendor (
+KDEICE_EXPORT char *IceVendor (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -519,7 +521,7 @@
 
 #define IceRelease KDE_IceRelease
 
-extern char *IceRelease (
+KDEICE_EXPORT char *IceRelease (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -527,7 +529,7 @@
 
 #define IceProtocolVersion KDE_IceProtocolVersion
 
-extern int IceProtocolVersion (
+KDEICE_EXPORT int IceProtocolVersion (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -535,7 +537,7 @@
 
 #define IceProtocolRevision KDE_IceProtocolRevision
 
-extern int IceProtocolRevision (
+KDEICE_EXPORT int IceProtocolRevision (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -543,7 +545,7 @@
 
 #define IceConnectionNumber KDE_IceConnectionNumber
 
-extern int IceConnectionNumber (
+KDEICE_EXPORT int IceConnectionNumber (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -551,7 +553,7 @@
 
 #define IceConnectionString KDE_IceConnectionString
 
-extern char *IceConnectionString (
+KDEICE_EXPORT char *IceConnectionString (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -559,7 +561,7 @@
 
 #define IceLastSentSequenceNumber KDE_IceLastSentSequenceNumber
 
-extern unsigned long IceLastSentSequenceNumber (
+KDEICE_EXPORT unsigned long IceLastSentSequenceNumber (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -567,7 +569,7 @@
 
 #define IceLastReceivedSequenceNumber KDE_IceLastReceivedSequenceNumber
 
-extern unsigned long IceLastReceivedSequenceNumber (
+KDEICE_EXPORT unsigned long IceLastReceivedSequenceNumber (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -575,7 +577,7 @@
 
 #define IceSwapping KDE_IceSwapping
 
-extern Bool IceSwapping (
+KDEICE_EXPORT Bool IceSwapping (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -583,7 +585,7 @@
 
 #define IceSetErrorHandler KDE_IceSetErrorHandler
 
-extern IceErrorHandler IceSetErrorHandler (
+KDEICE_EXPORT IceErrorHandler IceSetErrorHandler (
 #if NeedFunctionPrototypes
     IceErrorHandler 	/* handler */
 #endif
@@ -591,7 +593,7 @@
 
 #define IceSetIOErrorHandler KDE_IceSetIOErrorHandler
 
-extern IceIOErrorHandler IceSetIOErrorHandler (
+KDEICE_EXPORT IceIOErrorHandler IceSetIOErrorHandler (
 #if NeedFunctionPrototypes
     IceIOErrorHandler 	/* handler */
 #endif
@@ -604,7 +606,7 @@
 
 #define IceInitThreads KDE_IceInitThreads
 
-extern Status IceInitThreads (
+KDEICE_EXPORT Status IceInitThreads (
 #if NeedFunctionPrototypes
     void
 #endif
@@ -612,7 +614,7 @@
 
 #define IceAppLockConn KDE_IceAppLockConn
 
-extern void IceAppLockConn (
+KDEICE_EXPORT void IceAppLockConn (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
@@ -620,7 +622,7 @@
 
 #define IceAppUnlockConn KDE_IceAppUnlockConn
 
-extern void IceAppUnlockConn (
+KDEICE_EXPORT void IceAppUnlockConn (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */
 #endif
Index: KDE-ICE/ICEmsg.h
===================================================================
--- KDE-ICE/ICEmsg.h	(revision 471108)
+++ KDE-ICE/ICEmsg.h	(working copy)
@@ -33,13 +33,15 @@
 
 #include <KDE-ICE/ICEconn.h>
 
+#include "KDE-ICE.h"
+
 /*
  * Function prototypes for internal ICElib functions
  */
 
 #define _IceRead _kde_IceRead
 
-extern Status _IceRead (
+KDEICE_EXPORT Status _IceRead (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     unsigned long	/* nbytes */,
@@ -49,7 +51,7 @@
 
 #define _IceReadSkip _kde_IceReadSkip
 
-extern void _IceReadSkip (
+KDEICE_EXPORT void _IceReadSkip (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     unsigned long	/* nbytes */
@@ -58,7 +60,7 @@
 
 #define _IceWrite _kde_IceWrite
 
-extern void _IceWrite (
+KDEICE_EXPORT void _IceWrite (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     unsigned long	/* nbytes */,
@@ -67,11 +69,11 @@
 );
 
 #define _IceWriteHandler _kde_IceWriteHandler
-extern IceWriteHandler _IceWriteHandler;
+KDEICE_EXPORT IceWriteHandler _IceWriteHandler;
 
 #define _IceErrorBadMinor _kde_IceErrorBadMinor
 
-extern void _IceErrorBadMinor (
+KDEICE_EXPORT void _IceErrorBadMinor (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int			/* majorOpcode */,
@@ -82,7 +84,7 @@
 
 #define _IceErrorBadState _kde_IceErrorBadState
 
-extern void _IceErrorBadState (
+KDEICE_EXPORT void _IceErrorBadState (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int			/* majorOpcode */,
@@ -93,7 +95,7 @@
 
 #define _IceErrorBadLength _kde_IceErrorBadLength
 
-extern void _IceErrorBadLength (
+KDEICE_EXPORT void _IceErrorBadLength (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int			/* majorOpcode */,
@@ -104,7 +106,7 @@
 
 #define _IceErrorBadValue _kde_IceErrorBadValue
 
-extern void _IceErrorBadValue (
+KDEICE_EXPORT void _IceErrorBadValue (
 #if NeedFunctionPrototypes
     IceConn		/* iceConn */,
     int			/* majorOpcode */,
Index: KDE-ICE/SConscript
===================================================================
--- KDE-ICE/SConscript	(revision 471108)
+++ KDE-ICE/SConscript	(working copy)
@@ -33,7 +33,7 @@
 	obj.libs     = 'kdewin32 ws2_32'
 	# (js)
 	if env['CC'] == 'cl':
-		obj.ccflags += " /FI./../../win/include/kdelibs_export_win.h -DWIN32_LEAN_AND_MEAN " 
+		obj.ccflags += " /FI./../../win/include/kdelibs_export_win.h -DWIN32_LEAN_AND_MEAN -DMAKE_KDEICE_LIB " 
 else:
 	obj          = env.genobj('convenience', env)
 	obj.ccflags  ="-DICE_t -DTRANS_SERVER -DTRANS_CLIENT -DUNIXCONN -DANSICPP "
Index: SConscript
===================================================================
--- SConscript	(revision 471054)
+++ SConscript	(working copy)
@@ -17,7 +17,7 @@
 obj.libs     = 'kICE'
 obj.ccflags += '-DMAKE_DCOP_LIB'
 obj.cxxflags += '-DMAKE_DCOP_LIB'
-if env['WINDOWS'] and env['CC'] == 'gcc':
+if env['WINDOWS']:
 	obj.libpaths += ' ../win/'
 	obj.libs     += ' kdewin32 wsock32'
 obj.execute()
