Page 1 of 1

About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 12:49 pm
by Andy
:oops: I use VisualStdio 2015 set the "Hello world"project in the windows system project,but it always exit error C1083 :Cannot open include file: '../../../lib/vc_lib/mswud/wx/setup.h': No such file or directory. Then I do some work according to the solution from online forum. What's worse, it add the erro can't open the source file:H:\wxWidgets\wxWidgets-3.1.2\lib\vc_dll\mswud”: No such file or directory. My version is wxWidgets-3.1.2.I have compiled wxWidgets in windows and run other wxWisdgets project。
What's wrong with me :( ,please tell me the solution!!!!! This is the most difficulty when i learn wxWidgets.

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 12:59 pm
by doublemax
After you unpacked wxWidgets you need to build the wxWidgets libraries. Go to <wxdir>/build/msw/ and open wx_vc14.sln.
Select "Build Solution" from the "Build" menu. This will build one configuration (debug).
Switch Configuration to "Release" and build again.

Close VS.

Now go to <wxdir>/samples/minimal/ and open "minimal_vc9.vcproj". Let VS convert the project.
"Build Solution" again. Now you can run the "minimal" sample.

This all should work out of the box.

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:12 pm
by Andy
It still has old problem C1083: Cannot open include file: '../../../lib/vc_lib/mswud/wx/setup.h when I Build Solution from the <wxdir>/samples/minimal/ and open "minimal_vc9.vcproj".

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:13 pm
by doublemax
This still sounds like you either didn't build the wxWidgets libraries (step 1 from my previous post) or you built a different configuration.

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:17 pm
by Andy
I build the vc_dll not vc_lib,the erro indicate the vc_Lib/mswud/wx/setup.h

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:21 pm
by doublemax
Then you either have to re-build wxWidgets itself with the "Debug" configuration, or you need to change the configuration to "Debug DLL" when building the "minimal" sample.

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:28 pm
by Andy
I use DLL Debug /DLL Release can run the minimal project. Thank you!!! :)But my aims is to build own wxWidgets project .Why there is without DLL Debug /DLL Release in my own project.There is only Debug/Release and it not work. :oops:

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 1:41 pm
by doublemax
Building an empty VS studio project with wxWidgets from scratch is not an easy task. A lot of paths, libraries, preprocessor symbols etc. need to be set correctly.

I suggest to copy the "minimal" sample and modify it. As it uses relative paths to find wxWidgets, it won't work out of the box if you copy it to another directory. You need to go through the whole project (in all configurations) and change the relative paths to absolute ones. Or even better to paths that use an environment variable like WXWIN.

For each configuration there are three places where you need to change the path:
C/C++ -> General -> Additional Include Directories
Linker -> General -> Additional Library Directories
Resources -> General -> Additional Include Directories

Re: About lib/vc_lib/mswuwx/setup.h

Posted: Sun Dec 29, 2019 11:37 pm
by PB
doublemax wrote:
Sun Dec 29, 2019 1:41 pm
Building an empty VS studio project with wxWidgets from scratch is not an easy task. A lot of paths, libraries, preprocessor symbols etc. need to be set correctly.
I dare to disagree, it is actually very simple and should be done under five minutes.

The following assumes you have set the WXWIN environment variable correctly, so its value is something like c:\wxwidgets. Obviously, it also expects you built the requested configurations of wxWidgets.

For example, a simple guide below shows a wxWidgets-related MSVS project settings one needs to add for a DLL Debug configuration of a wxWidgets app. The titles in bold and italics in sections 1-4 correspond to the Configuration Properties of a project. Section 5 also describes modifications of the project needed for example for a Release or Static build.

1 General
Make sure Character Set is set to "Use Unicode Character Set".

2 C/C++
2.1 General/Additional Include Directories:

Code: Select all

$(WXWIN)\include\msvc; $(WXWIN)\include
2.2 Preprocessor/Preprocessor Definitions:

Code: Select all

__WXMSW__;WXUSINGDLL;_DEBUG
3 Linker
When you are using a MSVC-specific include (see step 2.1), all necessary libraries are linked automatically and you do not need to list their names, you just need to tell the linker where they are.
3.1 General/Additional Library Directories:

Code: Select all

$(WXWIN)\lib\vc_dll
4 Resources
The resources options may become available only once you add an .rc file to your project. You should have one, if only to add the application icon.
4.1 General/Additional Include Directories:

Code: Select all

$(WXWIN)\include

5 Additional tips
5.1 Making the wxWidgets DLLs available
If you use the DLL build, you must make the correct wxWidgets DLLs available to your program. Either copy them to the directory where the executable resides or just for running the app from the MSVS in Debugging set the Environment to

Code: Select all

PATH=$(WXWIN)\lib\vc_dll
5.2 Settings for for the Release configuration
In the preprocessor definitions (see step 2.2) replace

Code: Select all

_DEBUG
with

Code: Select all

NDEBUG
5.3 Static build
If you do not want a DLL build, remove this preprocessor definition (see step 2.2)

Code: Select all

WXUSINGDLL
and change the linker's library directory (see step 3.1) to

Code: Select all

$(WXWIN)\lib\vc_lib
5.4 DPI Awareness
Last but not least, if your application is DPI-aware (it better be in 2020), you should at least set its DPI Awareness in Manifest Tool/Input and Output to "High DPI Aware". But it may be better to include a proper application manifest, with Windows version compatibilities listed and having PerMonitorV2 awareness there. However, PMv2 DPI awareness support is not that good yet in wxWidgets, see e.g. here .

BTW, I expect you read this official guide for setting up wxWidgets apps on MSW?