Author Topic: Trying to get wxWidgets and C::B to be happy with one another...  (Read 12306 times)

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Trying to get wxWidgets and C::B to be happy with one another...
« on: February 05, 2006, 04:40:58 am »
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

Offline SamT

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #1 on: February 05, 2006, 07:37:48 am »

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

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #2 on: February 05, 2006, 03:23:46 pm »
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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #3 on: February 05, 2006, 03:57:01 pm »
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #4 on: February 05, 2006, 04:24:10 pm »
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 ...

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #5 on: February 05, 2006, 04:43:06 pm »
The thing is, none of the file editing you've done should be necessary. If you have MinGW installed, running "mingw32-make -f makefile.gcc" in the build/msw directory should work from the get-go. GCC/MinGW and Windows both support mixed forward- and backslashes.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #6 on: February 05, 2006, 07:42:55 pm »
I'm sure you're right.  The lack of "here's how I fixed the problem" postings in the archives atests to that.  But compiled via MSYS and configure, the wxWidgets work find (once the resulting DLLs are copied to the system subdirectory).  And C::B builds the templates/examples just fine, with MinGW set as the compiler.

So I can't figure out what is off.  It is almost as if there's some sort of flag that needs to be set.

If you've got any test compile that you can think of running, I'm all for trying.  I've had lcc-win and the the free Borland compiler installed before, but references to both have been taken out of the path and environment variables.  So I'm running out of ideas of things to change or try.

And that last compile?  It ended up bombing because it supposedly ran out of memory.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #7 on: February 05, 2006, 09:16:48 pm »
Hello,

You might also would like to have a look at this post.

Best wishes,
Michael

Offline mconsidine

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #8 on: February 06, 2006, 02:05:04 pm »
Hello,

You might also would like to have a look at this post.

Best wishes,
Michael


Thank you, thank you, thank you.  THAT works.  To recap what I did :
- deleted MinGW 3.4.5
- downloaded and unzipped the MinGW 3.4.2 files noted in the post above
   per the ANSI instructions
- downloaded the wxWidgets ZIP file and unzipped (as opposed to using the
   EXE installers)

Running the "mingw32-make" line as noted above worked fine (with the exception of
my filled-up laptop throwing a "low virtual memory" warning on the creation of the
monolithic DLL at the end of the process).

So what I end up with is 5 or 6 .a files and one DLL.

Again, THANK YOU VERY MUCH Michael.

If anyone sees that I'm missing some file, or can point out any locations that these files need to be copied, I'd be appreciative.  Otherwise, it's back to lurking...

Regards,
Matt

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #9 on: February 06, 2006, 02:19:14 pm »
Again, THANK YOU VERY MUCH Michael.
Hello,

You are welcome. Anyway you should thank Thomas for his really helpful instructions :D.

Best wishes,
Michael

Offline ZekeDragon

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #10 on: February 20, 2006, 08:17:23 pm »
Back to this, I'm having the exact problem as the guy above, and this should be simple to fix.  Literally, I can quote his words as to my precise difficulty.  The problem now is I can't see the post that was directed by Michael, it says

Hello,

You might also would like to have a look at this post.

Best wishes,
Michael


and when the link is clicked, it simply brings up a window that states "The topic or board you are looking for appears to be either missing or off limits to you."  This is annoying to say the least, is there something I'm not allowed to do on the board, or is it now deleted and I'm on my own?  I'll keep trying, and mirror what mconsidine has as his recap, maybe I can get it to work right.

- Zeke
I broke it again.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #11 on: February 20, 2006, 09:44:38 pm »
Maybe a permissions problem with that topic?
I 'll look into it in a while...
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #12 on: February 20, 2006, 10:03:47 pm »
Back to this, I'm having the exact problem as the guy above, and this should be simple to fix.  Literally, I can quote his words as to my precise difficulty.  The problem now is I can't see the post that was directed by Michael, it says

Hello,

You might also would like to have a look at this post.

Best wishes,
Michael


and when the link is clicked, it simply brings up a window that states "The topic or board you are looking for appears to be either missing or off limits to you."  This is annoying to say the least, is there something I'm not allowed to do on the board, or is it now deleted and I'm on my own?  I'll keep trying, and mirror what mconsidine has as his recap, maybe I can get it to work right.

- Zeke

Sorry, but I have no problem with the link. It works. The post was this:

http://forums.codeblocks.org/index.php?topic=1701.0

Try to logout and login again. Sometimes it helps.

Best wishes,
Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #13 on: February 20, 2006, 10:06:35 pm »
I checked. You should be able to access it (from group "Newcomer").
Anyway, I've lowered permissions so even guests can access that subforum. This should once and for all conclude problems with that thread.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline ZekeDragon

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Trying to get wxWidgets and C::B to be happy with one another...
« Reply #14 on: February 21, 2006, 07:29:37 am »
Seems to have worked well for the most part, I got the instructions, and actually figured out most of it myself, but got to a small snag point, particularly when I was building the nightly build of Code::Blocks so I don't stick around RC2.  According to the previous post, when the machine comes up, it should prompt you for the location of the global variable $(#WX).  However, it never prompted for anything, and it is not compiling.  I did some checking through it, and tried to manually define the variable above, but to no avail.  Perhaps there is something I'm missing?

- Zeke
I broke it again.