Author Topic: wxWidgets 2.6 (MSW, GCC) installation instructions  (Read 105312 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxWidgets 2.6 (MSW, GCC) installation instructions
« on: April 24, 2005, 06:12:24 am »
IMPORTANT: This first post is now obsolete. Check the latest post for the instructions.

OK. Here's how to build wxWidgets 2.6 + stc under Microsoft Windows™ to use with MINGW32.

(NOTE: Altho Code::Blocks still can't be compiled with this version of wxWidgets, I'm posting this in advance for when it's ready. The wx2.4.2 installation instructions are very similar. They're hidden er located elsewhere in this forum)

1) Download the package from wxwidgets.org and install. I downloaded the zip version and unzipped on a directory.

2) Make sure Your mingw gcc dir ( that's the mingw/bin directory) is in your system path (Right-click My Computer,properties, advanced options,
environment variables).

Note: This version of wxWidgets is designed to work with NATIVE win32 commands. Older versions (like 2.4.2) need the MSYS package to compile.

3) Open a Command window and change to the wxwidgets directory.
Suppose you installed in C:\wxWidgets-2.6.0:
Type:
Code: [Select]
cd {your-wxwidgets-dir}\build\msw

4)
Code: [Select]
make -f makefile.gcc SHARED=1 BUILD=release UNICODE=0
Go to dinner, watch TV and play some games while the compilation is done. [ Note: if you can't find a program called "make", try "mingw32-make" ]

5)
Code: [Select]
cd {your-wxwidgets-dir}\contrib\build\stc
make -f makefile.gcc WXUSINGDLL=1 BUILD=release SHARED=1 UNICODE=0

6)
Code: [Select]
explorer {your-wxwidgets-dir}\lib\gcc_lib
Copy everything there (subdirectories included) to your MINGW directory

7) Change directory to {your-wxwidgets-dir}\include
Copy everything there (including subdirectories) to your mingw "include" dir. NOTE: If you're still using wxwidgets 2.4.2, I suggest renaming your old "wx" dir to "wx242" so you can restore later.

8) Ta-da! You're ready to compile!

Anonymous

  • Guest
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #1 on: April 25, 2005, 07:31:58 pm »
I tryed the above but add c:\Dev-cpp\bin(on my computer but should point to mingw gcc dir) to my path since i think you forgot it in the instructions.  Make could not be found other wise. Compiled everything fine except no dll where created.  

Is this something i goof up on?

 I think it probbly becuase WXMAKINGDLL=1 might not be supported anymore but that just a guse. I ran out of time but want to try it with shared=1 like they say in documontaion.  Has any had any luck following these instruction?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #2 on: April 25, 2005, 08:05:56 pm »
Yes I did succesfully compile.. but I wanted to have a single dll :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #3 on: April 25, 2005, 08:44:52 pm »
Thanks for the complains about the instructions. I added the modifications. Now if you want to have a single DLL, i think you have to add the MONOLITHIC=1 in the make command. (Note: Haven't tested, it tho. Read the "readme" files regarding this option)

rahxephon

  • Guest
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #4 on: April 25, 2005, 11:50:48 pm »
First thank you. This really worked for me, i have tried to compile a simple wxWidget app since some days without success.

The file setup.h in lib\gcc_dll\msw\wx I copied to include\wx. I saw somewhere that it should be done, I don't remember where and don't know if it really matters.

Quote
Copy everything there (subdirectories included) to your MINGW directory

This is what you said in step 6. But in the subdirectories only the setup.h file is there. Well i did only copy the .a and .dll files to the mingw\lib directory. I don't know if this is what you meant. You only said MINGW directory which was a bit confusing.
By the way are the .a files really necessary since we already have the .dll files?

After making a new wxWidgets projekt in Codeblocks i had to make some changes. Under Linker Options/Link libraries i deleted the existing entry. Then i added C:\MinGW\lib\wxbase26_gcc_custom.dll and C:\MinGW\lib\wxmsw26_core_gcc_custom.dll. The order here didn't matter for me. I tried both.

I also tried only wxbase26_gcc_custom.dll and wxmsw26_core_gcc_custom.dll as an entry. I added my mingw\lib directory to both the compiler and linker. This didn't work. Can someone explain why?

After successful compiling and starting the app I got an error message that the dll was not found. I simply copied the two dlls in my project directory. It  did also work to copy the dlls in some directory where the directory was included into the Environment Variable PATH.

When i looked up how to compile wxWidgets 2.6 only the 4step was described in their documentation. What does the makefile under contrib\build\stc do?

Again thank you very much. I can finally start programming with wxWidgets.

Anonymous

  • Guest
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #5 on: April 26, 2005, 04:09:37 am »
OK here are the *OFFICIAL* instructions. Forget everything I posted previously.

---- (copied from the README-wx2.6.0 that will ship from now on) ---

Now that wxWidgets-2.6.0 is released, work has begun to port Code::Blocks to work with it.
Officialy, Code::Blocks still uses wxWidgets-2.4.2, until all issues from porting it to wxWidgets-2.6.0  are resolved.

KNOWN ISSUES
------------
Win32: MDI client window is not behaving correctly when maximized (initially, by code)

HOWTO build wxWidgets-2.6.0 for use with Code::Blocks
------------------------------------------------------
This process requires that you have MinGW installed. MSYS is *not* needed.
Download and decompress the wxWidgets-2.6.0 source distribution. For the rest of this small HOWTO, C:\wx2.6.0 will be assumed to be the directory wxWidgets-2.6.0 exists in.
Open a command prompt and type the following:

Code: [Select]
cd C:\wx2.6.0\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 UNICODE=0 VENDOR=cb
cd ..\..\contrib\build\stc
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 USE_XRC=1 UNICODE=0 VENDOR=cb


If all has gone well, the necessary libs and DLLs will exist in C:\wx2.6.0\lib\gcc_dll.

Copy the DLLs somewhere in your path (c:\windows\system32 is a good choice).

Open CodeBlocks-wx2.6.0.cbp with Code::Blocks and add the following search dirs:
Code: [Select]

Compiler:
C:\wx2.6.0\include
C:\wx2.6.0\contrib\include

Linker:
C:\wx2.6.0\lib\gcc_dll

Resource compiler:
C:\wx2.6.0\include

Now hit "Compile".
That's it!
Now, fix that MDI window bug ;)

REMARKS:
- If all goes well and you build Code::Blocks with wx2.6.0, but when you launch it it crashes, delete all plugins and hit "Compile" again (it will only link the plugins).
- Different object files output dirs are used for building Code::Blocks with wx2.6.0, so you can have Code::Blocks work with either wxWidgets version (2.4.2 or 2.6.0) independently.

If you have any problems, post them in the Development forum at http://www.codeblocks.org/index.php?name=PNphpBB2&file=viewforum&f=7

Yiannis.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #6 on: April 26, 2005, 04:11:46 am »
Um that was me. Forgot to log in. :oops:

Anonymous

  • Guest
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #7 on: April 29, 2005, 04:12:25 pm »

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #8 on: May 03, 2005, 08:31:17 pm »
When using the above instructions not every is compiled (such as OpenGL support :) or ODBC support) when you want to be able to have some special features (for compiling other programs) or remove some features (to reduce the size of the dll) you have to edit the setup.h file first.
You can find this setup.h file in the directory "<wxdir>/include/wx/msw/setup.h"
On other systems (unix, mac) you need to use the ./configure script.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Wx 2.6.0 Build Error
« Reply #9 on: June 08, 2005, 03:26:58 pm »
Sorry, if this is the wrong area to post a problem with wx 2.6.0 building, but here is my issue:  I am using CodeBlocks final beta and I followed the instruction above with only one change, I had to use "make" instead of "mingw32-make", and i got this error:

Code: [Select]
if not exist gcc_msw mkdir gcc_msw
if not exist ..\..\lib\gcc_lib\msw mkdir ..\..\lib\gcc_lib\msw
if not exist ..\..\lib\gcc_lib\msw\wx mkdir ..\..\lib\gcc_lib\msw\wx
if not exist ..\..\lib\gcc_lib\msw\wx\setup.h copy ..\..\include\wx\msw\setup.h
..\..\lib\gcc_lib\msw\wx\setup.h
        1 file(s) copied.
gcc -c -o gcc_msw\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -I..\..\inc
ude -I..\..\lib\gcc_lib\msw -D__WXMSW__    ../../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

It was quite difficult to grab, becuase that is the first of what must be hundreds of errors (they scroll by with almost one every line).  My hunch is that I am using the wrong version of make, can you help me.

BTW- wxWidgets is in c:\wx, so there are no file name spaces.

EDIT- Make version - 3.77

UPDATE-
I download Mingw 3.1.0-1 and wxWidgets is now compiling, but that only uses GCC 3.2.x.  Will this compiled version of wxWidgets work wtih codeblocks? and why does this compiled with an independent Mingw install but not codeblocks?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #10 on: June 08, 2005, 04:40:47 pm »
you need Make version 3.80.0 which you can download at the mingw website. Probably it will work then.
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #11 on: June 08, 2005, 04:49:29 pm »
Thanks, it is now compiling.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #12 on: June 08, 2005, 06:47:54 pm »
I am making a good story from this for wxWidgets 2.6.1, the story is like Ricks 2.4.2 compiling story. This story could come into the wiki.
I also including some suggestions for the paths and multiple builds.
Right now I am compiling codeblock with wxWidgets 2.6.1
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #13 on: June 08, 2005, 07:47:59 pm »
If you like you can sign up at the wiki and start editing. Because, "it ain't called a wiki for nuthin'!" (tm) :P

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
wxWidgets 2.6 (MSW, GCC) installation instructions
« Reply #14 on: June 08, 2005, 07:51:41 pm »
I know, already done :P (a few weeks ago)
I successfully compiled codeblocks with wx2.6.1, now I should only get rid of that resource message :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring