Kirix Support Forums

Static vs. dynamic linked library

Please post any wxAUI patches or modifications you've created here. Thanks!

Static vs. dynamic linked library

Postby 280Z28 on Wed Jan 11, 2006 9:23 am

We run into a problem because we statically link wxAUI but we dynamically link wxWidgets, so we have to delete all the WXDLLEXPORT statements in manager.h. Here's a fix that will work for everyone.

Place this at the top of manager.h:

Code: Select all
#if defined(WXMAKINGSTATIC_AUI) || defined(WXUSINGSTATIC_AUI)
#    define WXDLLIMPEXP_AUI
#    define WXDLLIMPEXP_DATA_AUI(type) type
#    define DECLARE_AUI_EVENT_TYPE(name, value) DECLARE_LOCAL_EVENT_TYPE(name, value)
#    define DEFINE_AUI_EVENT_TYPE(name) DEFINE_LOCAL_EVENT_TYPE(name)
#elif WXMAKINGDLL_AUI
#    define WXDLLIMPEXP_AUI WXEXPORT
#    define WXDLLIMPEXP_DATA_AUI(type) WXEXPORT type
#    define DECLARE_AUI_EVENT_TYPE(name, value) DECLARE_EVENT_TYPE(name, value)
#    define DEFINE_AUI_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name)
#elif defined(WXUSINGDLL)
#    define WXDLLIMPEXP_AUI WXIMPORT
#    define WXDLLIMPEXP_DATA_AUI(type) WXIMPORT type
#    define DECLARE_AUI_EVENT_TYPE(name, value) DECLARE_EVENT_TYPE(name, value)
#    define DEFINE_AUI_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name)
#else /* not making nor using DLL */
#    define WXDLLIMPEXP_AUI
#    define WXDLLIMPEXP_DATA_AUI(type) type
#    define DECLARE_AUI_EVENT_TYPE(name, value) DECLARE_LOCAL_EVENT_TYPE(name, value)
#    define DEFINE_AUI_EVENT_TYPE(name) DEFINE_LOCAL_EVENT_TYPE(name)
#endif


Change all of the WXDLLEXPORT statements to WXDLLIMPEXP_AUI.

Change all of DECLARE_EVENT_TYPE to DECLARE_AUI_EVENT_TYPE.

Change all of DEFINE_EVENT_TYPE to DEFINE_AUI_EVENT_TYPE.
280Z28
Registered User
 
Posts: 12
Joined: Sun Jan 01, 2006 10:16 pm
Location: Austin, TX > *

Building wxAUI as a dynamic library

Postby Guest on Fri Feb 17, 2006 1:50 am

I think I am missing something very basic here :oops: but I would like to compile wxAUI as a dynamic library (on windows).

I'm using wx 2.6.2.

What needs to be defined in the preprocessor?
Guest
 

Postby automatix on Wed Mar 08, 2006 10:15 am

I don't know what your experiences with this patch, but in my case it causes memory leaks :( , if i build wxaui after patch as dll an use it in progs.

Does anyone get it to run without leaks :?:

lars
automatix
Registered User
 
Posts: 9
Joined: Wed Feb 15, 2006 4:23 am
Location: Germany

Return to wxAUI Patches & Modifications