vc++ project template?

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
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

vc++ project template?

Post by tuk1 »

In the readme it says:

...you can always simply copy a makefile or project
file from %WXWIN%\samples\minimal or some other
sample and adapt it to your application.


Is there a way to create a new, stand-alone sln with the same project settings as 'minimal' ?

so, that..

New projects don't rely on 'minimal' project files.
&
The name of the project can be changed from 'minimal'.

Thanks!
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: vc++ project template?

Post by ONEEYEMAN »

Hi,
Yes, you absolutely can create a new project.

But then you will have to copy over all settings from the minimal solution. Its just easier to copy and adapt then create new and then basically re-create the appropriate project from the copy. This process is bound to errors.

Thank you.
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

ONEEYEMAN wrote:Hi,
.....Its just easier to copy and adapt then create new and then basically re-create the appropriate project from the copy. This process is bound to errors.
Can you describe the steps to do this?

So using the 'minimal' project, ...create a new project with the following:
a) different name
b) doesn't rely on the 'minimal' project files
c) 'minimal' project settings
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: vc++ project template?

Post by ONEEYEMAN »

Hi,
This is simple.

Open MSVC.
Create a new solution for a GUI application. Name it as you wish appropriate.
Open another copy of MSVC.
In another copy open the minimal solution from wxWidgets distribution.
Open the properties for the minimal solution.
Go back to the first copy and open the properties for your own solution.
Copy the settings from the 2nd copy of MSVC to the 1st copy. Adjust all path as appropriate.
Close second copy of MSVC.
Compile your project.

Copying the settings are bound to human errors.

Instead what the documentation advises is: open the Windows Explorer. Copy the <wxWidgets_folder>/samples/minimal to some place. Change the solution name and the project name as you see appropriate. Open the project file in the note/wordpad and change all references to minimal to you project name. Open the solution in MSVC. Fix all path and executable name. Compile. You don't copy any settings - you just changing the references to the name "minimal" as you wish. No errors from the human. And the process is simpler.

Thank you.
coderrc
Earned some good credits
Earned some good credits
Posts: 141
Joined: Tue Nov 01, 2016 2:46 pm

Re: vc++ project template?

Post by coderrc »

or just create a new project template ...

open up a wxwidgets minimal sample
file -> export template
follow the wizard, call it "wxWidgets Project"

file -> new -> project
templates | Visual C++ | -> "wxWidgets Project"
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

coderrc wrote:or just create a new project template ...

open up a wxwidgets minimal sample
file -> export template
follow the wizard, call it "wxWidgets Project"

file -> new -> project
templates | Visual C++ | -> "wxWidgets Project"
The resulting new project wont compile for me, link errors ..

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open source file: 'minimal.cpp': No such file or directory


If minimal.cpp and sample.rc are removed & "hello world.cpp" added to project then:

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'wx/wxprec.h': No such file or directory

---

http://docs.wxwidgets.org/trunk/overvie ... world.html
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: vc++ project template?

Post by ONEEYEMAN »

Hi,
Did you set the appropriate include and lib directories for the new project?

Thank you.
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

1.PNG
1.PNG (51.24 KiB) Viewed 2591 times
2.PNG
2.PNG (55.11 KiB) Viewed 2591 times
3.PNG
3.PNG (50.16 KiB) Viewed 2591 times
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

4.PNG
4.PNG (57.32 KiB) Viewed 2590 times
5.PNG
5.PNG (50.67 KiB) Viewed 2590 times
6.PNG
6.PNG (49.64 KiB) Viewed 2590 times
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

8.PNG
8.PNG (30.39 KiB) Viewed 2589 times
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: vc++ project template?

Post by ONEEYEMAN »

Hi,
What is ${WXWIN}? Where does it point to? Is it even defined?

Moreover - I wouldn't try to change the standard MSVC settings in "Configuration Properties -> VC++ Directories". After fixing the environment variable issue try to change the "C/C++ -> Additional Include Directories", "Linker -> General -> Output File". Also check the preprocessor definition - sample has much more defines than your project.

All this shouold fix the problem with wxprec.h.

Thank you.
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: vc++ project template?

Post by tuk1 »

Will check the rest tomorrow and report back.
Capture.PNG
-----

The template feature doesn't appear fit for this purpose.

Why so difficult to create new wx projects ...what am I missing here?
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
Post Reply