src/CodeBlocks_wx30.cbp | 1 -
src/include/cbexception.h | 2 +-
src/include/cbstyledtextctrl.h | 2 +-
src/include/editorcolourset.h | 2 +-
src/include/filemanager.h | 4 ++--
src/include/manager.h | 2 +-
src/include/scrollingdialog.h | 2 +-
src/include/xtra_res.h | 4 ++--
src/sdk/cbstyledtextctrl.cpp | 25 +++++++++++++++++++++++++
src/sdk/scrollingdialog.cpp | 3 ++-
src/sdk/wxscintilla/src/wxscintilla.cpp | 28 ++++++++++++++++++++++++++++
11 files changed, 64 insertions(+), 11 deletions(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index ac09ab1..5a304dd 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -136,7 +136,6 @@
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base" />
- <Add option="-Wl,--export-all-symbols" />
<Add option="-Wl,--add-stdcall-alias" />
<Add option="-Wl,--enable-auto-import" />
<Add option="-Wl,--no-undefined" />
diff --git a/src/include/cbexception.h b/src/include/cbexception.h
index 2044dd9..bfa91bc 100644
--- a/src/include/cbexception.h
+++ b/src/include/cbexception.h
@@ -20,7 +20,7 @@ cbThrow() and cbAssert().
*/
/** @brief The base Code::Blocks exception object. */
-class cbException
+class DLLIMPORT cbException
{
public:
cbException(const wxString& msg, const wxString& file, int line);
diff --git a/src/include/cbstyledtextctrl.h b/src/include/cbstyledtextctrl.h
index 55835a3..77c3d78 100644
--- a/src/include/cbstyledtextctrl.h
+++ b/src/include/cbstyledtextctrl.h
@@ -17,7 +17,7 @@ class wxFocusEvent;
class wxMouseEvent;
class wxPoint;
-class cbStyledTextCtrl : public wxScintilla
+class DLLIMPORT cbStyledTextCtrl : public wxScintilla
{
public:
cbStyledTextCtrl(wxWindow* pParent, int id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
diff --git a/src/include/editorcolourset.h b/src/include/editorcolourset.h
index a6573bd..e79ddac 100644
--- a/src/include/editorcolourset.h
+++ b/src/include/editorcolourset.h
@@ -73,7 +73,7 @@ struct OptionSet
};
WX_DECLARE_STRING_HASH_MAP(OptionSet, OptionSetsMap);
-class EditorColourSet
+class DLLIMPORT EditorColourSet
{
public:
EditorColourSet(const wxString& setName = COLORSET_DEFAULT);
diff --git a/src/include/filemanager.h b/src/include/filemanager.h
index 343c087..6d80f04 100644
--- a/src/include/filemanager.h
+++ b/src/include/filemanager.h
@@ -28,7 +28,7 @@ namespace TinyXML{ bool SaveDocument(const wxString&, TiXmlDocument*); }
// ***** class: LoaderBase *****
-class LoaderBase : public AbstractJob
+class DLLIMPORT LoaderBase : public AbstractJob
{
wxSemaphore sem;
bool wait;
@@ -109,7 +109,7 @@ public:
};
// ***** class: FileManager *****
-class FileManager : public Mgr<FileManager>
+class DLLIMPORT FileManager : public Mgr<FileManager>
{
BackgroundThread fileLoaderThread;
BackgroundThread uncLoaderThread;
diff --git a/src/include/manager.h b/src/include/manager.h
index 7dfe827..cd0cb30 100644
--- a/src/include/manager.h
+++ b/src/include/manager.h
@@ -179,7 +179,7 @@ private:
cbSearchResultsLog *m_SearchResultLog;
};
-template <class MgrT> class Mgr
+template <class MgrT> class DLLIMPORT Mgr
{
static MgrT *instance;
static bool isShutdown;
diff --git a/src/include/scrollingdialog.h b/src/include/scrollingdialog.h
index 33725fe..072d578 100644
--- a/src/include/scrollingdialog.h
+++ b/src/include/scrollingdialog.h
@@ -159,7 +159,7 @@ protected:
* A class that makes its content scroll if necessary
*/
-class wxScrollingDialog: public wxDialog
+class DLLIMPORT wxScrollingDialog: public wxDialog
#if !wxCHECK_VERSION(2,9,0)
, public wxDialogHelper
#endif
diff --git a/src/include/xtra_res.h b/src/include/xtra_res.h
index b8848d5..35494e3 100644
--- a/src/include/xtra_res.h
+++ b/src/include/xtra_res.h
@@ -13,7 +13,7 @@
class wxXmlResourceHandler;
-class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
+class DLLIMPORT wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
{
public:
wxToolBarAddOnXmlHandler();
@@ -30,7 +30,7 @@ class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
wxSize size = wxDefaultSize);
};
-class wxScrollingDialogXmlHandler : public wxDialogXmlHandler
+class DLLIMPORT wxScrollingDialogXmlHandler : public wxDialogXmlHandler
{
DECLARE_DYNAMIC_CLASS(wxScrollingDialogXmlHandler)
diff --git a/src/sdk/cbstyledtextctrl.cpp b/src/sdk/cbstyledtextctrl.cpp
index 4e3d6c6..dc8d06b 100644
--- a/src/sdk/cbstyledtextctrl.cpp
+++ b/src/sdk/cbstyledtextctrl.cpp
@@ -8,6 +8,16 @@
*/
#include "sdk_precomp.h"
+
+// this workaround an issue that WXEXPORT is defined as empty, so that wxScintilla class is not
+// exported from the codeblocks.dll
+#ifdef __WINDOWS__
+ #ifdef WXEXPORT
+ #undef WXEXPORT
+ #define WXEXPORT __declspec(dllexport)
+ #endif // WXEXPORT
+#endif // __WINDOWS__
+
#include "cbstyledtextctrl.h"
#ifndef CB_PRECOMP
#include <wx/gdicmn.h> // for wxPoint
@@ -539,3 +549,18 @@ void cbStyledTextCtrl::MakeNearbyLinesVisible(int line)
else if (dist >= LinesOnScreen() - 2)
LineScroll(0, 3 + dist - LinesOnScreen());
}
+
+
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
+
+/* Some example here */
+#ifdef WXEXPORT
+ #pragma message(VAR_NAME_VALUE(WXEXPORT))
+#else
+ #pragma message("WXEXPORT not defined")
+#endif
+
+
diff --git a/src/sdk/scrollingdialog.cpp b/src/sdk/scrollingdialog.cpp
index e847775..cef22e8 100644
--- a/src/sdk/scrollingdialog.cpp
+++ b/src/sdk/scrollingdialog.cpp
@@ -8,8 +8,9 @@
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////
+#include "sdk_precomp.h"
+
-#include "wx/wx.h"
#include "wx/module.h"
#include "wx/display.h"
#include "wx/bookctrl.h"
diff --git a/src/sdk/wxscintilla/src/wxscintilla.cpp b/src/sdk/wxscintilla/src/wxscintilla.cpp
index ca79dd2..8f033c6 100644
--- a/src/sdk/wxscintilla/src/wxscintilla.cpp
+++ b/src/sdk/wxscintilla/src/wxscintilla.cpp
@@ -45,8 +45,36 @@
#endif
#include "ScintillaWX.h"
+
+
+// this workaround an issue that WXEXPORT is defined as empty, so that wxScintilla class is not
+// exported from the codeblocks.dll
+#ifdef __WINDOWS__
+ #ifdef WXEXPORT
+ #undef WXEXPORT
+ #define WXEXPORT __declspec(dllexport)
+ #else
+ #define WXEXPORT __declspec(dllexport)
+ #endif // WXEXPORT
+
+#endif // __WINDOWS__
+
+
+
#include "wx/wxscintilla.h"
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
+
+/* Some example here */
+#ifdef WXEXPORT
+ #pragma message(VAR_NAME_VALUE(WXEXPORT))
+#else
+ #pragma message("WXEXPORT not defined")
+#endif
+
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
It looks like we need to export the functions which are from the static library (libwxscintilla_cb.a), some discussion:
, my solution is just add __declspec(dllexport) when building the static library.
But I still see other undefined errors.