The easy and rapid method to start wxWidgets project in visual studio 2019 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
hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 9:57 am

Hi ALL,

I am using visual studio 2019 to create GUI projects, the thing is each time I want to create a project to test something, I have to go through all the steps to include setup.h file lib includes and other stuff to get the project compiled. Sometimes it takes more time especially when you forgot something and you don't get a clean compile from the first test.
Is there any way to create a wxWidgets project with configuration stuff for release build 64 and 32?

Thank you in advance
S.Tairk

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2976
Joined: Sun Jan 03, 2010 5:45 pm

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by PB » Tue Apr 13, 2021 10:34 am

hinet wrote:
Tue Apr 13, 2021 9:57 am
I am using visual studio 2019 to create GUI projects, the thing is each time I want to create a project to test something, I have to go through all the steps
Why not just create a simple empty project once and then copy it when needed? That is what I do.

Anyway, the simplest way is to use the wxWidgets.props file (from the root of your wxWidgets folder), as described here:
https://docs.wxwidgets.org/trunk/plat_m ... build_apps

I think there were some issues with this file in certain scenarios in older wxWidets versions, but you are probably using the recent one, so...

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 11:13 am

PB wrote:
Tue Apr 13, 2021 10:34 am
hinet wrote:
Tue Apr 13, 2021 9:57 am
I am using visual studio 2019 to create GUI projects, the thing is each time I want to create a project to test something, I have to go through all the steps
Why not just create a simple empty project once and then copy it when needed? That is what I do.

Anyway, the simplest way is to use the wxWidgets.props file (from the root of your wxWidgets folder), as described here:
https://docs.wxwidgets.org/trunk/plat_m ... build_apps

I think there were some issues with this file in certain scenarios in older wxWidets versions, but you are probably using the recent one, so...
Hi PB,
I like this method of using the wxwidgets.props file, your solution is also good. I tried the wx.props solution the project build for all the configuration, debug and release (32 and 64).

If you use MSVS 2010 or later IDE for building your project, simply add wxwidgets.props property sheet to (all) your project(s) using wxWidgets by using "View|Property Manager" menu item to open the property manager window and then selecting "Add Existing Property Sheet..." from the context menu in this window.

The issue is while executing the project i get this message error:
Capture d’écran 2021-04-13 131020.png
Capture d’écran 2021-04-13 131020.png (10.03 KiB) Viewed 365 times
the samething with wxbase314ud_vc_custom.dll,

I verified my compilation project lib directory and the dlls exist, normally with the wxwidgets.props we should not add anything?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2976
Joined: Sun Jan 03, 2010 5:45 pm

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by PB » Tue Apr 13, 2021 11:16 am

I do not understand French.

But it seems that it is just Windows telling you that it cannot find wxWidgets DLLs. This cannot be done by a .props file. You need to place them where the executable can find them, just as with any other DLL.

But for just running the executable from MSVS, you could just do what I do, described in Step 5.1 here: viewtopic.php?f=19&t=46700#p196105
Last edited by PB on Tue Apr 13, 2021 11:30 am, edited 1 time in total.

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 11:26 am

PB wrote:
Tue Apr 13, 2021 11:16 am
I do not understand French.

But it seems that it is just Windows telling you that it cannot find wxWidgets DLLs. This cannot be done by a .props file. You need to place them where the executable can find them, just as with any other DLL.

But for just running the executable from MSVS, you could just do what I do, described in Step 5.1 here: viewtopic.php?f=19&t=46700
Perfect! :D =D>
Thank you!

Kvaz1r
Super wx Problem Solver
Super wx Problem Solver
Posts: 298
Joined: Tue Jun 07, 2016 1:07 pm

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by Kvaz1r » Tue Apr 13, 2021 1:50 pm

hinet wrote:
Tue Apr 13, 2021 9:57 am
I am using visual studio 2019 to create GUI projects, the thing is each time I want to create a project to test something, I have to go through all the steps to include setup.h file lib includes and other stuff to get the project compiled. Sometimes it takes more time especially when you forgot something and you don't get a clean compile from the first test.
Is there any way to create a wxWidgets project with configuration stuff for release build 64 and 32?
Do it one time, save as template(How to: Create project templates) and use it whenever you want.

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 3:42 pm

Kvaz1r wrote:
Tue Apr 13, 2021 1:50 pm
hinet wrote:
Tue Apr 13, 2021 9:57 am
I am using visual studio 2019 to create GUI projects, the thing is each time I want to create a project to test something, I have to go through all the steps to include setup.h file lib includes and other stuff to get the project compiled. Sometimes it takes more time especially when you forgot something and you don't get a clean compile from the first test.
Is there any way to create a wxWidgets project with configuration stuff for release build 64 and 32?
Do it one time, save as template(How to: Create project templates) and use it whenever you want.
I test it, =D>
The only thing missing in the project I create from the temple is the "Configuration prporties>Environment".
In the new project created using the template, I have to add it manually, I don't know why?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2976
Joined: Sun Jan 03, 2010 5:45 pm

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by PB » Tue Apr 13, 2021 6:00 pm

hinet wrote:
Tue Apr 13, 2021 3:42 pm
The only thing missing in the project I create from the temple is the "Configuration prporties>Environment".
In the new project created using the template, I have to add it manually, I don't know why?
I know nothing about MSVS templates. However, the reason why this cannot be done with a .props file is that this setting is stored in <YourProjectName>.vcxproj.user file and not <YourProjectName>.vcxproj file. May be the reason is similar for the project template?

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 8:45 pm

PB wrote:
Tue Apr 13, 2021 6:00 pm
hinet wrote:
Tue Apr 13, 2021 3:42 pm
The only thing missing in the project I create from the temple is the "Configuration prporties>Environment".
In the new project created using the template, I have to add it manually, I don't know why?
I know nothing about MSVS templates. However, the reason why this cannot be done with a .props file is that this setting is stored in <YourProjectName>.vcxproj.user file and not <YourProjectName>.vcxproj file. May be the reason is similar for the project template?
I add to the path the dir for .dll for 32 and 64 bits and to work perfectly.
However, I have another issue. I am reading a book about wxWidgets "Cross-platform Gui programming with wxWidgets" and I have examples to run and I have this issue when I copy files to my project.
I am using the wxxxx.prop file, it works generally but I don't know why this is not working with this project.
I have many problems because I want to start using VS for all my projects.
Thank you in advance,
Attachments
Capture d’écran 2021-04-13 224516.png

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5049
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by ONEEYEMAN » Tue Apr 13, 2021 10:03 pm

Hi,
Did you build the library itself?
Or you just ran the installer?

Open MSVC, go to "File -> Open", navigate to c:\wxWidgets\build\msw and open the file wx_vcN.sln.
Then go to "Build -> Batch Build...", click "Select All", then "Build".
Go make yourself a cup of coffee.
After the build is complete, open back up your project and try to build it.

Also be warned:

While the book is a good source of information, it was written more than decade ago. Alot of things have changed.

The best way right now would be to look at the different wxWidgets samples and the documentation.

Also keep in mind that unless you are required to have a backward compatibility - you should start using C++11/14/17 which has std::thread, STL and sockets.

Good luck.

Thank you.

hinet
Experienced Solver
Experienced Solver
Posts: 60
Joined: Mon Aug 08, 2016 9:44 am
Location: France
Contact:

Re: The easy and rapid method to start wxWidgets project in visual studio 2019

Post by hinet » Tue Apr 13, 2021 10:27 pm

ONEEYEMAN wrote:
Tue Apr 13, 2021 10:03 pm
Hi,
Did you build the library itself?
Or you just ran the installer?

Open MSVC, go to "File -> Open", navigate to c:\wxWidgets\build\msw and open the file wx_vcN.sln.
Then go to "Build -> Batch Build...", click "Select All", then "Build".
Go make yourself a cup of coffee.
After the build is complete, open back up your project and try to build it.

Also be warned:

While the book is a good source of information, it was written more than decade ago. Alot of things have changed.

The best way right now would be to look at the different wxWidgets samples and the documentation.

Also keep in mind that unless you are required to have a backward compatibility - you should start using C++11/14/17 which has std::thread, STL and sockets.

Good luck.

Thank you.
Hi,
Yes the library is already compiled and operational.
Yes i want to learn more things in details, the samples are good but, not very documented to lean deeply. Yes your alright many things are change but the bases are the same.

Post Reply