fatal error: wx/setup.h: No such file  [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.
Nico
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sun Nov 07, 2010 5:19 pm

fatal error: wx/setup.h: No such file

Postby Nico » Sun Dec 08, 2013 8:46 pm

Hello,

I am trying to build an older codeblocks plugin that depends on wxWidgets, so my problem might be related to a version difference but I hope somebody here can tell me how to fix it.

The plugin includes $(#wx)\include\wx\platform.h where in my case $(#wx) refers to C:\wxWidgets-3.0.0.

In plathform.h I get a fatal error:
C:\wxWidgets-3.0.0\include\wx\platform.h|189|fatal error: wx/setup.h: No such file or directory

because this include seems to be impossible:

Code: Select all

/*
   Include wx/setup.h for the Unix platform defines generated by configure and
   the library compilation options

   Note that it must be included before defining hardware symbols below as they
   could be already defined by configure but it must be included after defining
   the compiler macros above as msvc/wx/setup.h relies on them under Windows.
 */
#include "wx/setup.h"

I have checked and indeed there is no "C:\wxWidgets-3.0.0\include\wx\setup.h" like there was in wxWidgets 2.8.11.
Just in case it is of any importance: I'm using code::blocks 13.12 RC1 and the plugin is cbGcov (add code coverage to code::blocks)

My questions:
Using wxWidgets 3.0.0 in 32bit mode on windows 8 with gcc 4.7.1 compiler, how can i get this program to compile without causing future problems with the wxWidgets installation? Can I create an empty setup.h? Can I create a setup.h file with the proper content? Should I omit the include in platform.h ( I would probably feel uncomfortable doing that as I don't know what side effects it might have)? Should I add some other search-directory? Is there an other solution?

I hope somebody here is willing and able to help me on this one.

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

Re: fatal error: wx/setup.h: No such file  [SOLVED]

Postby doublemax » Sun Dec 08, 2013 8:51 pm

A project needs at least two include paths.

Each different configuration has its own setup.h, it's included from a different location than all other header files.

The exact location depends on the compiler and configuration.
E.g. in Visual Studio, Unicode / Debug build it would be:

Code: Select all

<wxdir>\lib\vc_lib\mswud\
This include path must be given first in the command line.
Use the source, Luke!

Nico
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sun Nov 07, 2010 5:19 pm

Re: fatal error: wx/setup.h: No such file

Postby Nico » Sun Dec 08, 2013 9:36 pm

Thanks, I feel a bit stupid but you did get me a big step further.

Kind regards, Nico

alan93
Experienced Solver
Experienced Solver
Posts: 93
Joined: Wed Feb 06, 2013 9:33 pm

Re: fatal error: wx/setup.h: No such file

Postby alan93 » Thu Dec 12, 2013 9:11 pm

doublemax wrote:A project needs at least two include paths.

Each different configuration has its own setup.h, it's included from a different location than all other header files.

The exact location depends on the compiler and configuration.
E.g. in Visual Studio, Unicode / Debug build it would be:

Code: Select all

<wxdir>\lib\vc_lib\mswud\
This include path must be given first in the command line.


I ran into this same problem using Visual Studio .
After installing wx 3.0.0 I got setup.h here:
<wxdir>\include\msvc\wx\setup.h

I had no vc_lib folder

but including this in project did not solve it.

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

Re: fatal error: wx/setup.h: No such file

Postby doublemax » Thu Dec 12, 2013 9:19 pm

There is a "master copy" of setup.h in <wxdir>\include\wx\msw\

When you build the libraries of a specific configuration, this version will be copied into the respective directory for this configuration. e.g. <wxdir>\lib\vc_lib\mswud\wx\

The latter is the path that always needs to be on top of the list of include paths, because that's the one where "setup.h" loaded from. All other include files come from <wxdir>\include\wx\
Use the source, Luke!

cdavalillo
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Jan 07, 2018 1:19 pm

Re: fatal error: wx/setup.h: No such file

Postby cdavalillo » Sun Jan 07, 2018 1:32 pm

Hello Im new in this but for me the solution was to replace the instruction #include "wx/setup.h" by this other #include "wx/msw/setup.h" in the platform.h file because I did install the 3.1.0 version of wxWidgets and the setup.h file need by the gcc compiler (MinGW) was in this folder.....

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

Re: fatal error: wx/setup.h: No such file

Postby doublemax » Sun Jan 07, 2018 1:49 pm

cdavalillo wrote:Hello Im new in this but for me the solution was to replace the instruction #include "wx/setup.h" by this other #include "wx/msw/setup.h" in the platform.h file because I did install the 3.1.0 version of wxWidgets and the setup.h file need by the gcc compiler (MinGW) was in this folder.....
You should never have to edit the source code to make wxWidgets compile. What you did only masks the real problem temporarily, but can cause more trouble in the long run.

Like i wrote in the post above, the setup.h in "include/wx/msw/" is the "master" copy that will be copied to a project-specific directory, e.g. <wxdir>\lib\vc_lib\mswud\wx\ for the "unicode, debug" configuration when using Visual Studio.

In your actual project, you'll need two include paths. The project-specific one from which only setup.h will get included and the default one "<wxdir>/include/" from which all other headers will be included.
Use the source, Luke!

shahbazkhan22
In need of some credit
In need of some credit
Posts: 1
Joined: Sat Oct 06, 2018 4:22 am

Re: fatal error: wx/setup.h: No such file

Postby shahbazkhan22 » Sat Oct 06, 2018 4:27 am

Other Simple method is by copying that 'setup.h' from location '<wx_dir>\lib\gcc_lib\mswu\wx' to the folder where your 'platform.h' is present. And edit the line '#include "wx/setup.h" ' as '#include "setup.h" '.

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

Re: fatal error: wx/setup.h: No such file

Postby doublemax » Sat Oct 06, 2018 8:20 am

shahbazkhan22 wrote:Other Simple method is by copying that 'setup.h' from location '<wx_dir>\lib\gcc_lib\mswu\wx' to the folder where your 'platform.h' is present. And edit the line '#include "wx/setup.h" ' as '#include "setup.h" '.
No, no and no. Never do that!
Use the source, Luke!

traderjoel
In need of some credit
In need of some credit
Posts: 1
Joined: Mon Oct 15, 2018 2:31 pm

Re: fatal error: wx/setup.h: No such file

Postby traderjoel » Mon Oct 15, 2018 3:19 pm

I'm trying to help out the OP here...

To fix the "fatal error: wx/setup.h: No such file" issue,

make sure the GCC command line has BUILD=release option. Chances are that the OP built wxWidgets using release. By default the debug version is being built. Therefore it is searching for setup.h under the debug folder lib\gcc_lib\mswud, but it is located under lib\gcc_lib\mswu, which is the release folder.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 3 guests