Hi, Tim, thanks.
I looked at your patches here:
https://github.com/stahta01/MINGW-packages/tree/codeblocks-git/mingw-w64-codeblocks-gitEspecially this one:
https://github.com/stahta01/MINGW-packages/blob/codeblocks-git/mingw-w64-codeblocks-git/007-makefile-wxsmith-plugin-export-fix.patchI see that you have added the "EXPORT_LIB" macro definition in the Makefile.am file in the compiler option.
I think defining this has the same effect as my change of the:
diff --git a/src/include/cbplugin.h b/src/include/cbplugin.h
index 10258e5..a3ce67b 100644
--- a/src/include/cbplugin.h
+++ b/src/include/cbplugin.h
@@ -23,11 +23,11 @@
#ifdef EXPORT_LIB
#define PLUGIN_EXPORT __declspec (dllexport)
#else // !EXPORT_LIB
- #ifdef BUILDING_PLUGIN
+ #if defined(BUILDING_PLUGIN) || defined(DLL_EXPORT)
#define PLUGIN_EXPORT __declspec (dllexport)
- #else // !BUILDING_PLUGIN
+ #else // !BUILDING_PLUGIN && !DLL_EXPORT
#define PLUGIN_EXPORT __declspec (dllimport)
- #endif // BUILDING_PLUGIN
+ #endif // BUILDING_PLUGIN || DLL_EXPORT
#endif // EXPORT_LIB
#endif // PLUGIN_EXPORT
#else
Because defining such macro will make the "#define PLUGIN_EXPORT __declspec (dllexport)" take effect.
But, when I search the build log(the build log I have days ago) of the configure/make result. I see that when we build plugins, we don't have such "EXPORT_LIB" defined in many plugins, for example, when build the codecompletion plugin or compiler plugin, I see the log code looks like below:
2024-09-24T11:47:33.4430652Z libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../src/include -ID:/msys64/mingw64/lib/wx/include/msw-unicode-3.2 -ID:/msys64/mingw64/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../../src/include/scripting/include -I../../../src/include -I../../../src/sdk/wxscintilla/include -I../../../src/plugins/compilergcc/depslib/src -DDEPSLIB_WINDOWS -DCB_AUTOCONF -DPIC -O2 -ffast-math -fPIC -fexceptions -MT compilermessages.lo -MD -MP -MF .deps/compilermessages.Tpo -c compilermessages.cpp -DDLL_EXPORT -DPIC -o .libs/compilermessages.o
or
2024-09-24T12:28:29.7971808Z libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../../../src/include -ID:/msys64/mingw64/lib/wx/include/msw-unicode-3.2 -ID:/msys64/mingw64/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../../../src/include -I../../../../src/sdk/wxscintilla/include -I../../../../src/include/tinyxml -I./src -I./src/LSPclient -I./src/codecompletion -I./src/winprocess -I./src/winprocess/asyncprocess -I./src/winprocess/misc -DCB_AUTOCONF -DPIC -O2 -ffast-math -fPIC -fexceptions -MT src/codecompletion/parser/parser.lo -MD -MP -MF src/codecompletion/parser/.deps/parser.Tpo -c src/codecompletion/parser/parser.cpp -DDLL_EXPORT -DPIC -o src/codecompletion/parser/.libs/parser.o
You see, the "-DDLL_EXPORT -DPIC" is always defined. When I looked at the Makefile.am for those plugins, I don't see they defined the EXPORT_LIB.
So, I'm not sure why those plugins can be built with out issue.
But when I looked at the cbp files for those plugins, I see "BUILDING_PLUGIN" is always defined in the cbp, from the cbplugin.h, I see that "BUILDING_PLUGIN" means "#define PLUGIN_EXPORT __declspec (dllexport)".
So, my question is: shall we enable all "__declspec (dllexport)" if I see the "-DDLL_EXPORT"? It looks like "DLL_EXPORT" comes from the configure/auto-make world, but I can't find its source.
Thanks.