build wxWidgets 2.8 in Visual Studio 2017 Pro

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
truth
In need of some credit
In need of some credit
Posts: 4
Joined: Thu May 24, 2018 8:44 pm

build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by truth »

I have a legacy application that I need to support that uses wxWidgets 2.8. I've successfully built the application in VS 2017 Pro but it fails to link.

It appears like I need to build wxWidgets 2.8 in VS. So far, that has failed. I can get into the specifics later but I just want to know if I'm likely wasting my time.

Is it at all feasible to build wxWidgets 2.8 in VS 2017 - on Windows 10 x64 against the latest Windows SDK?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by doublemax »

I tested a 32bit build with VS2017 community and the 8.1 SDK and it worked almost out of the box. Just had one error regarding "include "pbt.h" which could just be commented out.
Use the source, Luke!
truth
In need of some credit
In need of some credit
Posts: 4
Joined: Thu May 24, 2018 8:44 pm

Re: build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by truth »

Wow! That's great to know.
I also commented out the "pbt.h" line but I'm still getting loads of errors.

Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) qa C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\dbgrptg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) qa C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\dbgrptg.obj 1
Error (active) E1038 expected a string literal core c:\Users\\Source\Repos\CMO\wxWidgets2.8\include\wx\defs.h 2895
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) html C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\helpdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) html C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\helpdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) html C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\helpwnd.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) html C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\helpwnd.obj 1
Error LNK1561 entry point must be defined wxzlib C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\LINK 1
Error LNK1561 entry point must be defined wxjpeg C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\LINK 1
Error LNK1561 entry point must be defined wxtiff C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\LINK 1
Error MSB6006 "cmd.exe" exited with code 1. wxregex C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171
Error MSB6006 "cmd.exe" exited with code 1. base C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171
Error MSB6006 "cmd.exe" exited with code 1. net C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171
Error MSB6006 "cmd.exe" exited with code 1. odbc C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171
Error MSB6006 "cmd.exe" exited with code 1. xml C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 171
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error C1083 Cannot open include file: 'zlib.h': No such file or directory wxpng c:\users\\source\repos\cmo\wxwidgets2.8\src\png\png.h 346
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextformatdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextformatdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextstyledlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextstyledlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextsymboldlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\richtextsymboldlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) adv C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\tipdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) adv C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\tipdlg.obj 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) adv C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\wizard.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) adv C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\wizard.obj 1
Error LNK1120 2 unresolved externals adv C:\Users\\Source\Repos\CMO\wxWidgets2.8\lib\vc_dll\wxmsw28d_adv_vc_custom.dll 1
Error LNK1120 2 unresolved externals html C:\Users\\Source\Repos\CMO\wxWidgets2.8\lib\vc_dll\wxmsw28d_html_vc_custom.dll 1
Error LNK1120 2 unresolved externals qa C:\Users\\Source\Repos\CMO\wxWidgets2.8\lib\vc_dll\wxmsw28d_qa_vc_custom.dll 1
Error LNK1120 2 unresolved externals richtext C:\Users\\Source\Repos\CMO\wxWidgets2.8\lib\vc_dll\wxmsw28d_richtext_vc_custom.dll 1
Error LNK1120 2 unresolved externals xrc C:\Users\\Source\Repos\CMO\wxWidgets2.8\lib\vc_dll\wxmsw28d_xrc_vc_custom.dll 1
Error LNK2001 unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxButton::GetEventHashTable(void)const " (?GetEventHashTable@wxButton@@MBEAAVwxEventHashTable@@XZ) xrc C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\xh_bttn.obj 1
Error LNK2001 unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxButton::GetEventTable(void)const " (?GetEventTable@wxButton@@MBEPBUwxEventTable@@XZ) xrc C:\Users\\Source\Repos\CMO\wxWidgets2.8\build\msw\xh_bttn.obj 1
Error C1083 Cannot open include file: 'expat_config.h': No such file or directory wxexpat c:\users\\source\repos\cmo\wxwidgets2.8\src\expat\lib\xmlparse.c 30
Error C1083 Cannot open include file: 'expat_config.h': No such file or directory wxexpat c:\users\\source\repos\cmo\wxwidgets2.8\src\expat\lib\xmlrole.c 14
Error C1083 Cannot open include file: 'expat_config.h': No such file or directory wxexpat c:\users\\source\repos\cmo\wxwidgets2.8\src\expat\lib\xmltok.c 14
truth
In need of some credit
In need of some credit
Posts: 4
Joined: Thu May 24, 2018 8:44 pm

Re: build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by truth »

I'm using Batch Build and selecting all. It looks like all the 'Universal' configurations are failing because there is no setup.h file.
Do I even need the 'Universal' builds?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by doublemax »

truth wrote:I'm using Batch Build and selecting all. It looks like all the 'Universal' configurations are failing because there is no setup.h file.
Do I even need the 'Universal' builds?
No.

Usually you only need two builds, "debug" and "release" or "debug DLL" and "release DLL", depending on whether you want to link wxWidgets as DLLs or statically.

For the record, i used 2.8.12, not 2.8.
Use the source, Luke!
truth
In need of some credit
In need of some credit
Posts: 4
Joined: Thu May 24, 2018 8:44 pm

Re: build wxWidgets 2.8 in Visual Studio 2017 Pro

Post by truth »

I just wanted to close the loop on this.

I was able to build Debug and Release (DLL and Unicode) without error in the end, and as doublemax suggests, these were all I needed.
Post Reply