About lib/vc_lib/mswuwx/setup.h 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
Andy
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Dec 29, 2019 12:18 pm

About lib/vc_lib/mswuwx/setup.h

Post by Andy » Sun Dec 29, 2019 12:49 pm

: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.

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

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

Post by doublemax » Sun Dec 29, 2019 12:59 pm

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.
Use the source, Luke!

Andy
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Dec 29, 2019 12:18 pm

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

Post by Andy » Sun Dec 29, 2019 1:12 pm

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".

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

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

Post by doublemax » Sun Dec 29, 2019 1:13 pm

This still sounds like you either didn't build the wxWidgets libraries (step 1 from my previous post) or you built a different configuration.
Use the source, Luke!

Andy
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Dec 29, 2019 12:18 pm

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

Post by Andy » Sun Dec 29, 2019 1:17 pm

I build the vc_dll not vc_lib,the erro indicate the vc_Lib/mswud/wx/setup.h

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

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

Post by doublemax » Sun Dec 29, 2019 1:21 pm

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.
Use the source, Luke!

Andy
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Dec 29, 2019 12:18 pm

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

Post by Andy » Sun Dec 29, 2019 1:28 pm

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:

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

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

Post by doublemax » 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 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
Use the source, Luke!

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

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

Post by PB » Sun Dec 29, 2019 11:37 pm

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?

Post Reply