Mocha
Mocha

Reputation: 191

How to fix "Cannot find setup.h" error when building wxWidgets-3.1.2 project in Visual Studio?

When building a wxWidgets-3.1.2 project in Visual Studio (both the template from Nuget and the sample from the wxWidgets directory), the compiler generates the following error:

Error C1083 Cannot open include file: '../../../lib/vc_dll/mswud/wx/setup.h': No such file or directory Project1 c:\wxwidgets-3.1.2\include\msvc\wx\setup.h 125

I already built the wxWidgets DLLs in VS so that's not the problem.

I cannot fix this since the file location is in the wxWidgets source code and I don't want to modify that source code. But I really need to compile my project. Please help.

Upvotes: 0

Views: 2192

Answers (3)

Mocha
Mocha

Reputation: 191

It turns out that I had built the release DLLs but not the debug DLLs. So that was my mistake. After I built the debug DLLs I was able to compile the application.

Upvotes: 1

VZ.
VZ.

Reputation: 22688

You need to configure your application to use wxWidgets correctly. As the installation instructions say:

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.

If you do this, you won't have any problems.

Upvotes: 1

rveerd
rveerd

Reputation: 4006

When building wxWidgets, wxWidgets creates (copies) setup.h in $(WXWIN)\lib\vc_lib\mswud\wx\setup.h with $(WXWIN) the directory where you installed wxWidgets.

You need to add the directory $(WXWIN)\lib\vc_lib\mswud to the Additional Include Directories in Visual Studio.

Upvotes: 1

Related Questions