It looks like the wxWidgets dll we build by the command like "mingw32-make ....", which does not have dllexport decortation enabled. See "D:\wx3\include\wx\dlimpexp.h", this means the mingw's linker option: "-export-all-symbols" is enabled by default.
I have manfully add DLLIMPORT to many sdk's headers, and currently, sdk and src, some plugins are build fine. (in this case, need to use the "-export-all-symbols" when building sdk)
But I see one error when building compiler plugin:
-------------- Build: Compiler in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[100.0%] g++.exe -shared -Wl,--dll -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 -Lplugins\compilergcc\depslib .objs30\plugins\compilergcc\advancedcompileroptionsdlg.o .objs30\plugins\compilergcc\compiler_defs.o .objs30\plugins\compilergcc\compilerCYGWIN.o .objs30\plugins\compilergcc\compilererrors.o .objs30\plugins\compilergcc\compilerflagdlg.o .objs30\plugins\compilergcc\compilerG95.o .objs30\plugins\compilergcc\compilergcc.o .objs30\plugins\compilergcc\compilerGDC.o .objs30\plugins\compilergcc\compilerGNUARM.o .objs30\plugins\compilergcc\compilerGNUFortran.o .objs30\plugins\compilergcc\compilerIAR.o .objs30\plugins\compilergcc\compilerICC.o .objs30\plugins\compilergcc\compilerKeilC51.o .objs30\plugins\compilergcc\compilerLCC.o .objs30\plugins\compilergcc\compilermessages.o .objs30\plugins\compilergcc\compilerMINGW.o .objs30\plugins\compilergcc\compilerMINGWgenerator.o .objs30\plugins\compilergcc\compilerMSVC.o .objs30\plugins\compilergcc\compilerMSVC10.o .objs30\plugins\compilergcc\compilerMSVC8.o .objs30\plugins\compilergcc\compileroptionsdlg.o .objs30\plugins\compilergcc\compilerOW.o .objs30\plugins\compilergcc\compilerOWgenerator.o .objs30\plugins\compilergcc\compilerXML.o .objs30\plugins\compilergcc\directcommands.o -o devel30\share\CodeBlocks\plugins\compiler.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -mthreads -lcodeblocks -lwxmsw30ud -ldepslib
.objs30\plugins\compilergcc\advancedcompileroptionsdlg.o: In function `ZN26AdvancedCompilerOptionsDlgC2EP8wxWindowRK8wxString':
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:72: undefined reference to `RegExArray::~RegExArray()'
.objs30\plugins\compilergcc\advancedcompileroptionsdlg.o: In function `ZN26AdvancedCompilerOptionsDlgD2Ev':
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:82: undefined reference to `RegExArray::~RegExArray()'
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:82: undefined reference to `RegExArray::~RegExArray()'
While, I found that RegExArray is defined in sdk's header
WX_DECLARE_OBJARRAY(RegExStruct, RegExArray);
Refer to the wx's document:
wxWidgets: interface/wx/dynarray.h File Reference, I change to the export version of this macro
WX_DECLARE_EXPORTED_OBJARRAY(RegExStruct, RegExArray);
But the linker error still happens. I looked at this macro:
#define WX_DECLARE_EXPORTED_OBJARRAY(T, name) \
WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, WXDLLIMPEXP_CORE)
And something in "D:\wx3\include\wx\dlimpexp.h"
#ifdef WXMAKINGDLL_CORE
# define WXDLLIMPEXP_CORE WXEXPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXEXPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_CORE WXIMPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXIMPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXIMPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#else /* not making nor using DLL */
# define WXDLLIMPEXP_CORE
# define WXDLLIMPEXP_DATA_CORE(type) type
# define WXDLLIMPEXP_INLINE_CORE
#endif
This means WXDLLIMPEXP_CORE is expanded to an empty string... Thus, RegExArray can't be exported easily.