From 9f38fe4bfc3e9dd7d2acaf294d15106490543c6b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 Dec 2009 03:04:39 +0000 Subject: [PATCH] Define MY_DLL_BUILDING symbol for dll sample DLL build. This is necessary to properly define MY_DLL_DECL as either WXIMPORT or WXEXPORT depending on whether my_dll.h is included from DLL itself or from outside it. Without this, MSVC generated warnings about inconsistent dll linkage. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dll/Makefile.in | 3 +- samples/dll/dll.bkl | 1 + samples/dll/dll_my_dll.dsp | 96 +++++++++++++++---------------- samples/dll/dll_vc7_my_dll.vcproj | 48 ++++++++-------- samples/dll/dll_vc8_my_dll.vcproj | 48 ++++++++-------- samples/dll/dll_vc9_my_dll.vcproj | 48 ++++++++-------- samples/dll/makefile.bcc | 3 +- samples/dll/makefile.gcc | 4 +- samples/dll/makefile.vc | 4 +- samples/dll/makefile.wat | 4 +- samples/dll/my_dll.cpp | 10 ++-- samples/dll/my_dll.h | 10 +++- 12 files changed, 145 insertions(+), 134 deletions(-) diff --git a/samples/dll/Makefile.in b/samples/dll/Makefile.in index f2faf24e21..e81bca99b9 100644 --- a/samples/dll/Makefile.in +++ b/samples/dll/Makefile.in @@ -50,7 +50,8 @@ WX_VERSION = $(WX_RELEASE).1 LIBDIRNAME = $(wx_top_builddir)/lib MY_DLL_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ - $(__DLLFLAG_p) -I$(srcdir) $(PIC_FLAG) $(CXXWARNINGS) $(CPPFLAGS) $(CXXFLAGS) + $(__DLLFLAG_p) -DMY_DLL_BUILDING -I$(srcdir) $(PIC_FLAG) $(CXXWARNINGS) \ + $(CPPFLAGS) $(CXXFLAGS) MY_DLL_OBJECTS = \ my_dll_my_dll.o WX_EXE_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \ diff --git a/samples/dll/dll.bkl b/samples/dll/dll.bkl index 2eeb512a59..8c7c3e5ad5 100644 --- a/samples/dll/dll.bkl +++ b/samples/dll/dll.bkl @@ -8,6 +8,7 @@ cond="PLATFORM_WIN32=='1'"> $(DLLFLAG) + MY_DLL_BUILDING $(SRCDIR) my_dll.cpp diff --git a/samples/dll/dll_my_dll.dsp b/samples/dll/dll_my_dll.dsp index 5e4708f0ab..2231de6610 100644 --- a/samples/dll/dll_my_dll.dsp +++ b/samples/dll/dll_my_dll.dsp @@ -47,12 +47,12 @@ RSC=rc.exe # PROP Output_Dir "vc_mswunivudll" # PROP Intermediate_Dir "vc_mswunivudll\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswunivudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswunivudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivu" /i ".\..\..\include" /d "WXUSINGDLL" /i . -# ADD RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivu" /i ".\..\..\include" /d "WXUSINGDLL" /i . +# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswunivudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswunivudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivu" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivu" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -72,12 +72,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswunivuddll" # PROP Intermediate_Dir "vc_mswunivuddll\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswunivuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswunivuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivud" /i ".\..\..\include" /d "WXUSINGDLL" /i . -# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivud" /i ".\..\..\include" /d "WXUSINGDLL" /i . +# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswunivuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswunivuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivud" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswunivud" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -97,12 +97,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswudll" # PROP Intermediate_Dir "vc_mswudll\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswu" /i ".\..\..\include" /d "WXUSINGDLL" /i . -# ADD RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswu" /i ".\..\..\include" /d "WXUSINGDLL" /i . +# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswudll\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_dll\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswu" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswu" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -122,12 +122,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswuddll" # PROP Intermediate_Dir "vc_mswuddll\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswud" /i ".\..\..\include" /d "WXUSINGDLL" /i . -# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswud" /i ".\..\..\include" /d "WXUSINGDLL" /i . +# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswuddll\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_dll\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "WXUSINGDLL" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswud" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_dll\mswud" /i ".\..\..\include" /d "WXUSINGDLL" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -147,12 +147,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswunivu" # PROP Intermediate_Dir "vc_mswunivu\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswunivu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswunivu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivu" /i ".\..\..\include" /i . -# ADD RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivu" /i ".\..\..\include" /i . +# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswunivu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswunivu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivu" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivu" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -172,12 +172,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswunivud" # PROP Intermediate_Dir "vc_mswunivud\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswunivud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswunivud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivud" /i ".\..\..\include" /i . -# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivud" /i ".\..\..\include" /i . +# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswunivud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswunivud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswunivud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "__WXUNIVERSAL__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivud" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "__WXUNIVERSAL__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswunivud" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -197,12 +197,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswu" # PROP Intermediate_Dir "vc_mswu\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswu" /i ".\..\..\include" /i . -# ADD RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswu" /i ".\..\..\include" /i . +# ADD BASE CPP /nologo /FD /MD /Zi /Fdvc_mswu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MD /Zi /Fdvc_mswu\my_dll.pdb /opt:ref /opt:icf /O2 /GR /EHsc /I ".\..\..\lib\vc_lib\mswu" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswu" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswu" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo @@ -222,12 +222,12 @@ LINK32=link.exe # PROP Output_Dir "vc_mswud" # PROP Intermediate_Dir "vc_mswud\my_dll" # PROP Target_Dir "" -# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /c -# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /c -# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /mktyplib203 /win32 -# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswud" /i ".\..\..\include" /i . -# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswud" /i ".\..\..\include" /i . +# ADD BASE CPP /nologo /FD /MDd /Zi /Fdvc_mswud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD CPP /nologo /FD /MDd /Zi /Fdvc_mswud\my_dll.pdb /Od /Gm /GR /EHsc /I ".\..\..\lib\vc_lib\mswud" /I ".\..\..\include" /W4 /I "." /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /c +# ADD BASE MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD MTL /nologo /D "WIN32" /D "_USRDLL" /D "DLL_EXPORTS" /D "_DEBUG" /D "__WXMSW__" /D "_UNICODE" /D "MY_DLL_BUILDING" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswud" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . +# ADD RSC /l 0x409 /d "_DEBUG" /d "__WXMSW__" /d "_UNICODE" /i ".\..\..\lib\vc_lib\mswud" /i ".\..\..\include" /d "MY_DLL_BUILDING" /i . BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo diff --git a/samples/dll/dll_vc7_my_dll.vcproj b/samples/dll/dll_vc7_my_dll.vcproj index f711a087ac..9426329bc7 100644 --- a/samples/dll/dll_vc7_my_dll.vcproj +++ b/samples/dll/dll_vc7_my_dll.vcproj @@ -28,7 +28,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".\..\..\lib\vc_lib\mswud;.\..\..\include;." - PreprocessorDefinitions="WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;_UNICODE" + PreprocessorDefinitions="WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;_UNICODE;MY_DLL_BUILDING" MinimalRebuild="TRUE" ExceptionHandling="TRUE" BasicRuntimeChecks="3" @@ -57,7 +57,7 @@ TargetMachine="1"/> @@ -67,7 +67,7 @@ Name="VCPreLinkEventTool"/> @@ -131,7 +131,7 @@ Name="VCPreLinkEventTool"/> @@ -196,7 +196,7 @@ Name="VCPreLinkEventTool"/> @@ -260,7 +260,7 @@ Name="VCPreLinkEventTool"/> @@ -325,7 +325,7 @@ Name="VCPreLinkEventTool"/> @@ -389,7 +389,7 @@ Name="VCPreLinkEventTool"/> @@ -454,7 +454,7 @@ Name="VCPreLinkEventTool"/> @@ -518,7 +518,7 @@ Name="VCPreLinkEventTool"/> @@ -135,14 +135,14 @@ /> @@ -225,14 +225,14 @@ /> @@ -316,14 +316,14 @@ /> @@ -406,14 +406,14 @@ /> @@ -497,14 +497,14 @@ /> @@ -587,14 +587,14 @@ /> @@ -678,14 +678,14 @@ /> diff --git a/samples/dll/dll_vc9_my_dll.vcproj b/samples/dll/dll_vc9_my_dll.vcproj index bb31b098f0..01d5e356d6 100644 --- a/samples/dll/dll_vc9_my_dll.vcproj +++ b/samples/dll/dll_vc9_my_dll.vcproj @@ -44,7 +44,7 @@ /> @@ -134,7 +134,7 @@ /> @@ -224,7 +224,7 @@ /> @@ -314,7 +314,7 @@ /> @@ -404,7 +404,7 @@ /> @@ -494,7 +494,7 @@ /> @@ -584,7 +584,7 @@ /> @@ -674,7 +674,7 @@ /> diff --git a/samples/dll/makefile.bcc b/samples/dll/makefile.bcc index bef956cafd..61882c8299 100644 --- a/samples/dll/makefile.bcc +++ b/samples/dll/makefile.bcc @@ -33,7 +33,8 @@ MY_DLL_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) $(__MSLU_DEFINE_p) \ $(__GFXCTX_DEFINE_p) -I$(SETUPHDIR) -I.\..\..\include \ - $(____CAIRO_INCLUDEDIR_FILENAMES) $(__DLLFLAG_p) -I. $(CPPFLAGS) $(CXXFLAGS) + $(____CAIRO_INCLUDEDIR_FILENAMES) $(__DLLFLAG_p) -DMY_DLL_BUILDING -I. \ + $(CPPFLAGS) $(CXXFLAGS) MY_DLL_OBJECTS = \ $(OBJS)\my_dll_my_dll.obj WX_EXE_CXXFLAGS = $(__RUNTIME_LIBS) -I$(BCCDIR)\include $(__DEBUGINFO) \ diff --git a/samples/dll/makefile.gcc b/samples/dll/makefile.gcc index e6e4db6d09..d48e2e38f7 100644 --- a/samples/dll/makefile.gcc +++ b/samples/dll/makefile.gcc @@ -25,8 +25,8 @@ MY_DLL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \ $(__UNICODE_DEFINE_p) $(__MSLU_DEFINE_p) $(__GFXCTX_DEFINE_p) \ -I$(SETUPHDIR) -I.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES) -W -Wall \ - $(__DLLFLAG_p) -I. $(__RTTIFLAG) $(__EXCEPTIONSFLAG) -Wno-ctor-dtor-privacy \ - $(CPPFLAGS) $(CXXFLAGS) + $(__DLLFLAG_p) -DMY_DLL_BUILDING -I. $(__RTTIFLAG) $(__EXCEPTIONSFLAG) \ + -Wno-ctor-dtor-privacy $(CPPFLAGS) $(CXXFLAGS) MY_DLL_OBJECTS = \ $(OBJS)\my_dll_my_dll.o WX_EXE_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) $(GCCFLAGS) \ diff --git a/samples/dll/makefile.vc b/samples/dll/makefile.vc index ac4d06d553..f9f109b622 100644 --- a/samples/dll/makefile.vc +++ b/samples/dll/makefile.vc @@ -26,8 +26,8 @@ MY_DLL_CXXFLAGS = /M$(__RUNTIME_LIBS_11)$(__DEBUGRUNTIME) /DWIN32 \ $(__DEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \ $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) $(__MSLU_DEFINE_p) \ $(__GFXCTX_DEFINE_p) /I$(SETUPHDIR) /I.\..\..\include \ - $(____CAIRO_INCLUDEDIR_FILENAMES) /W4 $(__DLLFLAG_p) /I. $(__RTTIFLAG) \ - $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS) + $(____CAIRO_INCLUDEDIR_FILENAMES) /W4 $(__DLLFLAG_p) /DMY_DLL_BUILDING /I. \ + $(__RTTIFLAG) $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS) MY_DLL_OBJECTS = \ $(OBJS)\my_dll_my_dll.obj WX_EXE_CXXFLAGS = /M$(__RUNTIME_LIBS_25)$(__DEBUGRUNTIME) /DWIN32 \ diff --git a/samples/dll/makefile.wat b/samples/dll/makefile.wat index 33482a7c81..4becc28d7a 100644 --- a/samples/dll/makefile.wat +++ b/samples/dll/makefile.wat @@ -234,8 +234,8 @@ MY_DLL_CXXFLAGS = -bd $(__DEBUGINFO_1) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) & $(__UNICODE_DEFINE_p) $(__GFXCTX_DEFINE_p) -i=$(SETUPHDIR) & -i=.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES) -wx -wcd=549 -wcd=656 & - -wcd=657 -wcd=667 $(__DLLFLAG_p) -i=. $(__RTTIFLAG) $(__EXCEPTIONSFLAG) & - $(CPPFLAGS) $(CXXFLAGS) + -wcd=657 -wcd=667 $(__DLLFLAG_p) -dMY_DLL_BUILDING -i=. $(__RTTIFLAG) & + $(__EXCEPTIONSFLAG) $(CPPFLAGS) $(CXXFLAGS) MY_DLL_OBJECTS = & $(OBJS)\my_dll_my_dll.obj WX_EXE_CXXFLAGS = $(__DEBUGINFO_1) $(__OPTIMIZEFLAG) $(__THREADSFLAG) & diff --git a/samples/dll/my_dll.cpp b/samples/dll/my_dll.cpp index 8097479b7b..4b67d6d04e 100644 --- a/samples/dll/my_dll.cpp +++ b/samples/dll/my_dll.cpp @@ -231,7 +231,9 @@ unsigned wxSTDCALL MyAppLauncher(void* event) // public DLL interface // ---------------------------------------------------------------------------- -extern "C" WXEXPORT +extern "C" +{ + void run_wx_gui_from_dll(const char *title) { // In order to prevent conflicts with hosting app's event loop, we @@ -291,9 +293,7 @@ void run_wx_gui_from_dll(const char *title) wxQueueEvent(wxApp::GetInstance(), event); } - -extern "C" WXEXPORT -void wx_dll_cleanup(void) +void wx_dll_cleanup() { wxCriticalSectionLocker lock(gs_wxStartupCS); @@ -311,3 +311,5 @@ void wx_dll_cleanup(void) CloseHandle(gs_wxMainThread); gs_wxMainThread = NULL; } + +} // extern "C" diff --git a/samples/dll/my_dll.h b/samples/dll/my_dll.h index ffb53a1053..0ec954f22c 100644 --- a/samples/dll/my_dll.h +++ b/samples/dll/my_dll.h @@ -15,11 +15,17 @@ extern "C" { #endif +#ifdef MY_DLL_BUILDING + #define MY_DLL_DECL WXEXPORT +#else + #define MY_DLL_DECL WXIMPORT +#endif + // launch wx UI from some application that may or may not be written in wx -WXIMPORT void run_wx_gui_from_dll(const char *title); +MY_DLL_DECL void run_wx_gui_from_dll(const char *title); // run this to shutdown running threads etc. -WXIMPORT void wx_dll_cleanup(void); +MY_DLL_DECL void wx_dll_cleanup(); #ifdef __cplusplus -- 2.45.2