Build for Visual Studio 2019

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.
purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 11:35 am

The latest stable release (3.0.4) of wxWidgets includes solutions for MSVC12 i.e. upto Visual Studio 2013.

I recently changed it to Visual Studio 2019. Can I convert the "wx_vc12.sln" Solution file to 2019 and build the wxWidgets?

I tried it, it worked " Build: 24 succeeded, 0 failed, 0 up-to-date, 0 skipped" except for a few warning messages left behind.

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 11:54 am

Yes. As you already noticed, that works :)
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 11:57 am

Thanks, the warning messages are fine?

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 12:05 pm

purplex88 wrote:
Mon Jun 10, 2019 11:57 am
Thanks, the warning messages are fine?
I don't know which warnings you got ;)
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 12:44 pm

Probably castings. I closed the project already but I hope it will be fine!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 1:34 pm

Okay, here's a list:
Severity Code Description Project File Line Suppression State
Warning C4244 'return': conversion from '__int64' to 'XML_Index', possible loss of data wxexpat C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\expat\lib\xmlparse.c 1868
Warning C4267 '+=': conversion from 'size_t' to 'long', possible loss of data wxjpeg C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\jpeg\jmemmgr.c 306
Warning C4267 '+=': conversion from 'size_t' to 'long', possible loss of data wxjpeg C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\jpeg\jmemmgr.c 366
Warning C4267 '-=': conversion from 'size_t' to 'long', possible loss of data wxjpeg C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\jpeg\jmemmgr.c 976
Warning C4267 '-=': conversion from 'size_t' to 'long', possible loss of data wxjpeg C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\jpeg\jmemmgr.c 990
Warning C4244 '=': conversion from 'tmsize_t' to 'int', possible loss of data wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_jpeg.c 1802
Warning C4244 '=': conversion from 'tmsize_t' to 'uInt', possible loss of data wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_pixarlog.c 908
Warning C4244 'initializing': conversion from '__int64' to 'int', possible loss of data wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_print.c 397
Warning C4267 'function': conversion from 'size_t' to 'int', possible loss of data wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_print.c 677
Warning C4018 '<=': signed/unsigned mismatch wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_write.c 235
Warning C4244 '=': conversion from 'tmsize_t' to 'uInt', possible loss of data wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_zip.c 240
Warning C4018 '<=': signed/unsigned mismatch wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_write.c 381
Warning C4312 'type cast': conversion from 'int' to 'thandle_t' of greater size wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_win32.c 221
Warning C4311 'type cast': pointer truncation from 'thandle_t' to 'int' wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_win32.c 266
Warning C4311 'type cast': pointer truncation from 'thandle_t' to 'int' wxtiff C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\tiff\libtiff\tif_win32.c 321
Warning C4996 'GetVersionExW': was declared deprecated base C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\common\strconv.cpp 2817
Warning C4535 calling _set_se_translator() requires /EHa base C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\msw\main.cpp 184
Warning C4535 calling _set_se_translator() requires /EHa base C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\msw\thread.cpp 591
Warning C4324 'wx_error_mgr': structure was padded due to alignment specifier core C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\common\imagjpeg.cpp 153
Warning C4996 'GetVersionExW': was declared deprecated core C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\msw\app.cpp 271
Warning C4310 cast truncates constant value core C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\msw\listctrl.cpp 2803
Warning C4456 declaration of 'position' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextctrl.cpp 687
Warning C4456 declaration of 'hitObj' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextctrl.cpp 688
Warning C4456 declaration of 'contextObj' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextctrl.cpp 689
Warning C4456 declaration of 'hit' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextctrl.cpp 690
Warning C4456 declaration of 'child' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 2127
Warning C4456 declaration of 'node' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 2250
Warning C4456 declaration of 'para' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 2756
Warning C4456 declaration of 'para' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 2811
Warning C4456 declaration of 'end' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 2887
Warning C4456 declaration of 'item' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextctrl.cpp 5085
Warning C4457 declaration of 'def' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 4196
Warning C4456 declaration of 'node' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 5400
Warning C4457 declaration of 'size' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 6935
Warning C4457 declaration of 'size' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 6940
Warning C4456 declaration of 'converter' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 10099
Warning C4456 declaration of 'converter' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 10201
Warning C4456 declaration of 'converter' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 10448
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 318
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 324
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 330
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 336
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 342
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 349
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 356
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 362
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 368
Warning C4457 declaration of 'page' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 374
Warning C4456 declaration of 'obj' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 11615
Warning C4456 declaration of 'marginRect' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 12070
Warning C4456 declaration of 'size' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 517
Warning C4456 declaration of 'borderRect' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 12070
Warning C4456 declaration of 'contentRect' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 12070
Warning C4456 declaration of 'paddingRect' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 12070
Warning C4456 declaration of 'outlineRect' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextbuffer.cpp 12070
Warning C4457 declaration of 'event' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextformatdlg.cpp 776
Warning C4456 declaration of 'def' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextstyles.cpp 99
Warning C4457 declaration of 'def' hides function parameter richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextstyles.cpp 330
Warning C4456 declaration of 'text' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextxml.cpp 444
Warning C4456 declaration of 'style' hides previous local declaration richtext C:\Users\purplex88\AppData\Roaming\wxWidgets-3.0.4\src\richtext\richtextxml.cpp 2373
That's 60 warnings. What do you think?

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 1:56 pm

These look pretty harmless, i get the same with the combination wx304 and VS2015.

But unless you want to build an old project that requires 3.0.x, i'd still use 3.1.2 or the latest version from GIT. Even for production.
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 2:51 pm

Yes, doublemax. I should get 3.1 as well. Thanks, since earlier I was using it. :)

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 3:52 pm

Okay, 3.1.2 gave me no warnings and compiled fine

But when I compile a program I get an error:
1>LINK : fatal error LNK1104: cannot open file 'C:\Users\purplex88\AppData\Roaming\wxWidgets-3.1.2\lib\vc_dll.obj'
However, the minimal sample builds fine.

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 3:58 pm

Is the path correct?
Are you actually linking dynamically (DLLs) to wxWidgets?

Just make sure you use the same configuration for your application that you used when building wxWidgets.
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 4:10 pm

Paths look correct. The error happens at link time.

What does "vc_dll.obj" even mean? Is there supposed be "vc_dll.obj" file?

I am compiling with this switch:
"Multi-threaded Debug DLL (/MDd)"
.

My link path is:
C:\Users\purplex88\AppData\Roaming\wxWidgets-3.1.2\lib\vc_dll
is also correct

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 4:23 pm

What does "vc_dll.obj" even mean? Is there supposed be "vc_dll.obj" file?
Yes.
"Multi-threaded Debug DLL (/MDd)"
That only controls if the C runtime (CRT) is linked statically or not. This has nothing to do with wxWidgets being statically or dynamically linked.

"vc_dll" means that you're linking to the wxWidgets DLLs. Is that what you want? If yes, did you build these configurations when building wxWidgets itself? That would be the configurations "DLL Debug" and "DLL Release".
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 4:53 pm

Yes, I used "DLL Debug" to build them. I am using "WXUSINGDLL" macro as well:

Code: Select all

WIN32
_DEBUG
__WXMSW__
_UNICODE
WXUSINGDLL
_WINDOWS
_CRT_SECURE_NO_WARNINGS
Note there's no "vc_dll.obj" file in or outside the vc_dll folder.

User avatar
doublemax
Moderator
Moderator
Posts: 13990
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Build for Visual Studio 2019

Post by doublemax » Mon Jun 10, 2019 4:59 pm

I can't tell you exactly where, but there is a configuration mismatch somewhere. Build the wxWidgets libs again and check which files are created and where.

Then double check the configuration of your app, especially linker paths and library names.
Use the source, Luke!

purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 221
Joined: Mon Feb 24, 2014 3:14 pm

Re: Build for Visual Studio 2019

Post by purplex88 » Mon Jun 10, 2019 7:12 pm

Yes, I had wrong project configurations. I created a new project and now it works.

Is there any better solution to:
This program can't start because wxbase312ud_vc_custom.dll is missing from your computer.
Rather than moving wxbase312ud_vc_custom.dll next to .exe? I can't run the project from Visual Studio.
Last edited by purplex88 on Tue Jun 11, 2019 6:10 am, edited 2 times in total.

Post Reply