Dami
Dami

Reputation: 139

setup.h no such file or directory

Hello I am trying to build wxWidgets 3.0 for use with code blocks. When I run the command given on the manual

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport

It says an error include \include/setup/.h:121:27: fatal error: ../../../lib/vc_x64_lib/mswu/wx/setup.h

It also says

C:\wxWidgets-3.0.4\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
if not exist ..\..\lib\gcc_dll\mswu mkdir ..\..\lib\gcc_dll\mswu
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
In file included from ..\..\include/wx/platform.h:183:0,
                 from ..\..\include/wx/defs.h:27,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/setup.h:12:6: error: #error "This file should only be included when using Microsoft Visual C++"
     #error "This file should only be included when using Microsoft Visual C++"
      ^
In file included from ..\..\include/wx/version.h:16:0,
                 from ..\..\include/wx/setup.h:19,
                 from ..\..\include/wx/platform.h:183,
                 from ..\..\include/wx/defs.h:27,
                 from ../../src/regex/regcustom.h:39,
                 from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
..\..\include/wx/setup.h:113:31: error: pasting "/" and "vc_x64_lib" does not give a valid preprocessing token
         wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)

The manual I’m following is : http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef

Upvotes: 0

Views: 2854

Answers (2)

VZ.
VZ.

Reputation: 22688

You must have copied the file include/msvc/wx/setup.h to include/wx/setup.h manually, there is no other explanation for this file being there. You must not do it and now you need to remove the file you created and undo any other changes you may have done for the build to work.

Upvotes: 1

Ripi2
Ripi2

Reputation: 7198

If anything you try still gives errors then follow these instructions:

  1. Remove the whole of the wxWidgets folder, in your case C:\wxWidgets-3.0.4

  2. Re-install wxWidgets, even in that same directory

  3. Remove anything related to your old gcc (likely a dir and the PATH var, see below), and download an install a more recent version of gcc. From Mingw 32 mingw-get-setup.exe, from Mingw 64 or from TDM combined 32/64. You will need to set this compiler as the default one to C::B later, for your app.

  4. Add if needed your mingw/bin dir to the Windows PATH environment var.

  5. Open an command box window and copy&paste this line:

    mingw32-make -f makefile.gcc BUILD=release UNICODE=1 USE_OPENGL=1 CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"

Note I've removed the MONOLITHIC=1 flag, sometimes it's a source of problems. The only consequence is that you have to add to your project settings a few libs (base, core, etc and in a proper order) instead of an only big one. Take a look at <wxWidgets dir>\lib

Addin mingw\bin to the PATH is an option. C::B doesn't need it. It's the command box who needs it. If you don't want to pollute the PATH var then you have to add it each time you open a command box to use the compiler:
Execute PATH=%PATH%;C:\MinGW\bin (where MinGW is where you installed the compiler) before using the compiler in this command box.

Upvotes: 0

Related Questions