Use of .props file in Visual Studio

1,320 views
Skip to first unread message

t...@raisedbar.net

unread,
Jan 21, 2019, 5:17:11 AM1/21/19
to wx-users

Hi,

 

Can I please clarify which .props file needs to be incorporated into a WX-based Visual Studio project and how it should be added.

 

I’ve tried wxwidgets.props, wx_config.props and wx_setup.props in my VS2017 project, but I get fatal errors at compilation time for any encountered WX headers (file not found). I added the properties file by right-clicking on my project and choosing the “Add existing item” option. Where am I going wrong?

 

Best wishes.

 

Tim Burgess

Raised Bar Ltd.

E: t...@raisedbar.net

M: +44 (0)7989 486976

 

t...@raisedbar.net

unread,
Jan 21, 2019, 7:10:40 AM1/21/19
to wx-u...@googlegroups.com

OK, having realised that a .props file is just XML, I’ve now got the wxWidgets.props file correctly imported using the Properties Manager. However, compilation now yields errors like:

 

1>c:\wxwidgets-3.1.2\include\msvc\wx\setup.h(125): fatal error C1083: Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No such file or directory

 

The project concerned builds fine if I specify the include and library paths using the traditional method.

 

Best wishes.

 

Tim Burgess

Vadim Zeitlin

unread,
Jan 21, 2019, 10:16:45 AM1/21/19
to wx-u...@googlegroups.com
On Mon, 21 Jan 2019 12:10:36 -0000 wrote:

> OK, having realised that a .props file is just XML, I’ve now got the
> wxWidgets.props file correctly imported using the Properties Manager.

Just for the record, the correct file to use in your own projects is
wxwidgets.props prominently present in the root directory. The .props files
under build/msw are only used when building wxWidgets itself (although if
you create wx_local.props there, the customizations in it would affect both
wxWidgets and your use of it, but this is a more "advanced" topic).

> However, compilation now yields errors like:
>
> 1>c:\wxwidgets-3.1.2\include\msvc\wx\setup.h(125): fatal error C1083:
> Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No such
> file or directory

It looks like the "Character Set" property in your project (in the
"General" section of the configuration properties tree) is not set to "Use
Unicode Character Set". You need to set it when using Unicode version of
wxWidgets (alternatively, you could build wxWidgets in non-Unicode mode but
this is strongly *not* recommended and is still supported for compatibility
reasons only).

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

t...@raisedbar.net

unread,
Jan 21, 2019, 11:32:40 AM1/21/19
to wx-u...@googlegroups.com
Hi,

I was pretty sure that I was set up to build a Unicode project, but I'v just double-checked and that property is already correctly set. Any other ideas, please?

Best wishes.

Tim Burgess

Vadim Zeitlin

unread,
Jan 21, 2019, 11:37:12 AM1/21/19
to wx-u...@googlegroups.com
On Mon, 21 Jan 2019 16:32:34 -0000 wrote:

> I was pretty sure that I was set up to build a Unicode project, but I'v
> just double-checked and that property is already correctly set. Any other
> ideas, please?
...
> > 1>c:\wxwidgets-3.1.2\include\msvc\wx\setup.h(125): fatal error C1083:
> > Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No
> > such file or directory
>
> It looks like the "Character Set" property in your project (in the
> "General" section of the configuration properties tree) is not set

Oops, sorry, I still think the reason is related to Unicode mismatch, but
I thought about the wrong option. You should (also) check that your
preprocessor definitions contain _UNICODE. Normally it should be set by
default too, but in your case it somehow isn't, which results in "mswd",
instead of "mswud", above.

t...@raisedbar.net

unread,
Jan 21, 2019, 5:09:18 PM1/21/19
to wx-u...@googlegroups.com
Hi,

That did the trick - many thanks, as usual.


Best wishes.

Tim Burgess

-----Original Message-----
From: wx-u...@googlegroups.com <wx-u...@googlegroups.com> On Behalf Of
Vadim Zeitlin
Reply all
Reply to author
Forward
0 new messages