using wxWidgets in static library Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 212
Joined: Thu Aug 03, 2017 12:20 pm

using wxWidgets in static library

Post by Natulux » Wed Jan 29, 2020 1:39 pm

Hey

I created a class which needs a bunch of files and I want to use that class accross multiple wxWidgets projects.
I never created a (static) library myself, but I thought it might be of good use here because I could just copy (or link to) one precompiled lib (and its include) to use that class.

Problem is: In that class I use wxWidgets features. And I want to include it in projects also using wxWidgets.

Compiling the library I get several wxWidgets #error-Directives:
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_ACTIVEX must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 19
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_ANY must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 88
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_COMPILER_TLS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 96
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_CONSOLE_EVENTLOOP must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 104
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_CRASHREPORT must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 35
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_DBGHELP must be defined" HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 43
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_DC_CACHEING must be defined" HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 51
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_DIALUP_MANAGER must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 59
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_DYNAMIC_LOADER must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 168
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_DYNLIB_CLASS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 112
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_EXCEPTIONS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 120
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_FILESYSTEM must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 136
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_FILE_HISTORY must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 128
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_FSVOLUME must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 152
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_FSWATCHER must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 160
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_FS_ARCHIVE must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 144
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_INICONF must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 75
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_INTL must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 176
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_IPV6 must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 184
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_LOG must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 192
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_LONGLONG must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 200
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_MIMETYPE must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 208
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_MS_HTML_HELP must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 67
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_OLE must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 83
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_OLE_AUTOMATION must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 91
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_ON_FATAL_EXCEPTION must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 216
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_PRINTF_POS_PARAMS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 224
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_PROTOCOL must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 232
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_REGEX must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 274
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 282
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_SOCKETS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 306
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STDPATHS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 290
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STD_CONTAINERS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 314
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STD_CONTAINERS_COMPATIBLY must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 322
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STD_STRING_CONV_IN_WXSTRING must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 330
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STOPWATCH must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 346
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_STREAMS must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 338
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_TASKBARBUTTON must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 107
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_TASKBARICON_BALLOONS must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 99
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_TEXTBUFFER must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 354
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_TEXTFILE must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 362
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_UNSAFE_WXSTRING_CONV must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 378
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_URL must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 386
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_UXTHEME must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 115
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_VARIANT must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 394
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_WINRT must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 27
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_WINSOCK2 must be defined." HttpsClient C:\wxWidgets-3.1.3\include\wx\msw\chkconf.h 123
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_XLOCALE must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 402
Fehler (aktiv) E0035 #error-Direktive: "wxUSE_XML must be defined, please read comment near the top of this file." HttpsClient C:\wxWidgets-3.1.3\include\wx\chkconf.h 298
I included "wx/wx.h" but I cant add any of the wxWidget dlls. Is there a way to get selected static wxW libraries so I can include them into my library?

Cheers
Natu

Natulux
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 212
Joined: Thu Aug 03, 2017 12:20 pm

Re: using wxWidgets in static library

Post by Natulux » Wed Jan 29, 2020 1:58 pm

Ah, nevermind. I used a non functional wxWidgets compilation.

The missing flags are in found in lib\vc_lib\mswu\wx\setup.h
I needed to set the additional include path (lib\vc_lib\mswu) which I usually have in my linker settings.

Post Reply