Author Topic: Compiling a wxWidgets application - wx/setup.h: No such file or directory  (Read 51426 times)

JedSch

  • Guest
Re: Compiling a wxWidgets application - wx/setup.h: No such file or directory
« Reply #15 on: September 04, 2009, 10:44:27 pm »
I had this same problem with a missing "wx\setup.h". I was trying to work on my project on two different computers with Code::Blocks and wxWidgets installed in different directories on each computer.
The solution I found did involve the wrong search directories for header files. From the menu, go to "Project\Build Options...". Then go to the "Search Directories" tab and make sure that the directories there point to the right include folders for both the main project and the build targets (on the left side in the tree; you must select each one).

For the main project options:
Under the "Compiler" tab, there should exist two: "<wxWidgets>\include" and "<wxWidgets>\contrib\include".
"Linker" is empty, and "Resource Compiler" has "<wxWidgets>\include".

For each build target (release, debug, etc.):
"Compiler" should have "<wxWidgets>\lib\gcc_lib\msw" or "<wxWidgets>\lib\gcc_lib\mswu" if wxWidgets was built with Unicode support.
"Linker" should have "<wxWidgets>\lib\gcc_lib".
"Resource Compiler" should have the same as "Compiler".
If you are using dll libraries, each 'gcc_lib' above should be changed to 'gcc_dll'.

As for debug and release builds of your project, when you build wxWidgets, you must specify "BUILD=release" or "BUILD=debug". The lib files produced by the debug build have a 'd' appended to the end of the file name. E.g. "libwxjpeg.a" is the release library, while "libwxjpegd.a" is the debug version.  Just make sure that in the wizard you choose the same options that you built wxWidgets with: Monolithic ,Shared(dll), and Unicode.
The __WXDEBUG__ option under the advanced options in the wizard set whether you want to debug wxWidgets, not your project.

To recap the options when building wxWidgets, wxWidgets can be built with both of several options:
--SHARED=0 (.a linked libraries) and SHARED=1 (.dll libraries)--the lib files are placed in different directories (gcc_lib and gcc_dll)
--UNICODE=0 and UNICODE=1--the unicode support versions have a 'u' appended to the file name
--BUILD=debug and BUILD=release--the lib files for the debug build have a 'd' appended to the file name itself
==MONOLITHIC=0 or MONOLITHIC=1--wxWidgets cannot be built with both of these at the same time as some file names overlap