User forums > Help

Trying to get wxWidgets and C::B to be happy with one another...

(1/4) > >>

mconsidine:
I have been unable to get wxWidgets to compile (WinXP notebook, MingGW 3.4)  using the makefile.gcc provided or the installer found on another thread, but can get the sample programs to run off of DLLs created using the "./configure" route.

Can anyone point me to how I can go from this setup to the setup one would get by successfully completing the makefile/installer route?   That is, how can the relevant .lib, .dll and directory structures be created such that C::B will happily compile the provided wxWidget and wxSmith templates?

I'd be appreciative of any help that can be provided.

TIA,
Matt

SamT:

I follow the instruction in WiKi and success to compile wxWidget 2.6.2 under XP console.
My procedure is very simple.
1. download wxWidget 2.6.2 package from www.wxwidgets.org (http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.6.2-Setup.exe)

2. Install into correct folder

3. Enter into the folder which contain compile configuration (Ex: C:\wxWidgets-2.6.2\build\msw)

4. Before your compile wxWidgets, make sure your compiler is working and can be found.

4.1 Since I am using mingw 3.4.4 and it's pre-installed in C:\Program Files\CodeBlocks\bin. So, this path should be included into my environment setting.

4.2 Test the gcc version in C:\wxWidgets-2.6.2\build\msw folder. For example:
C:\wxWidgets-2.6.2\build\msw>gcc -v
Reading specs from C:/program files/codeblocks/bin/../lib/gcc/mingw32/3.4.4/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.4 (mingw special)

Success!

5. Edit config.gcc under same folder. My personal suggests you to edit this file by yourself and you will know each of the setting of wxWidgets for compiling.

5.1 Following the WiKi, some of the value should be considered for example:
USE_XRC=1
SHARED=1
MONOLITHIC=1
BUILD=release
UNICODE=1
You can find the explanation in each parameter in config.gcc which will let you build lib or dll.

6. After you save the modification of the config.gcc, you can start to compile it by using the following command:
mingw32-make -f makefile.gcc

Note: if you don't want to modify config.gcc, you still can use the command which descirbed in WiKi... for example:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0

7. It takes around 50 minutes on my system. All the compile files will be stored in subfolder under your config file's folder (Ex: C:\wxWidgets-2.6.2\build\msw\gcc_mswudll) and the lib file is stored under lib folder (Ex: C:\wxWidgets-2.6.2\lib\gcc_dll)

Now, you get your version of wxWidgets and it's ready to use... :D

mconsidine:
Thank you very much for your reply.  I had found the Wiki pages and rechecked that everything was as you wrote.  This, for example, is the output from the gcc check you suggested :

==========================
C:\wxWidgets\build\msw>gcc -v
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as -
-host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shar
ed --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --ena
ble-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-sync
hronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)

C:\wxWidgets\build\msw>
==========================

Unfortunately, this is what I get after the "mingw32-make" command is executed :
============================================
C:\WXWIDG~1\build\msw>mingw32-make -f makefile.gcc
gcc -c -o gcc_mswdll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -I..\..\i
nclude -I..\..\lib\gcc_dll\msw -D__WXMSW__    -MTgcc_mswdll\wxregex_regcomp.o -M
Fgcc_mswdll\wxregex_regcomp.o.d -MD ../../src/regex/regcomp.c
In file included from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
../../src/regex/regcustom.h:39:23: wx/wxchar.h: No such file or directory
In file included from ../../src/regex/regguts.h:38,
                 from ../../src/regex/regcomp.c:33:
../../src/regex/regcustom.h:82: error: syntax error before "chr"
../../src/regex/regcustom.h:82: warning: data definition has no type or storage
============================================================

... this output is followed by a lot more errors.

It seems to me that something must be goofy with the forward and backslashes.  I tried editting the makefile to deal with this, but that didn't seem to work either.

Yet if I load up MSYS and go through ./configure and mingw32-make, I get DLLs against which the wxWidgets sample executables run (e.g. bombs, fractal, etc).  But doing it this way means I don't end up with the LIBs, DLLs and directory structure that C::B seems to expect (at least as far as compiling the C::B wxWidgets template goes).

As I am not real familiar with makefiles, some pointers on a) how I can run make such that I don't get the above messages or b) how I can take what I do have and manually create what is expected by C::B would be of great help.

Sorry for the bandwidth, or if I am missing something very simple...

Matt

TDragon:
Well, read your error message. The very first one you get is "wx/wxchar.h: No such file or directory". So do a search in your wxWidgets sources to see if you even have that file. (Hint: It normally resides at include/wx/wxchar.h in your wxWidgets directory.) If you don't, it's simple -- your wxWidgets sources are incomplete. Delete the whole directory and re-extract the sources from the zip. If the file is where it's supposed to be, however, it probably means your MinGW installation is corrupted or incomplete.

mconsidine:
Actually, at the moment it doesn't appear that either problem is the case (i.e. both the MinGW and wxWidgets installs are correct).  What I ended up doing is going through the makefile and *making sure* that every backslash related to a directory/path was changed to a forward slash.  (Note the difference in the slashes used in the "-I" option and those in the file paths ...)

After doing that,
  mingw32-make -f makefile
seems to be working, only throwing the warnings that have been warned about.

FWIW ...

Navigation

[0] Message Index

[#] Next page

Go to full version