Wx is a pain to install on Windows using ActivePerl 5.10.1 and a MS compiler. This post details one way of installing it.

I got in touch with the maintainer of Wx after writing this post. Save for the incompatibility with VS6, all the issues listed in this post have been resolved. See Re: Installation instructions for Wx (wxWidgets fomerly wxWindows) using ActivePerl (update) for details.

It crashes Visual Studio 6's compiler, so start by upgrading your compiler:

  1. Download "Visual C++ 2008 Express edition".
  2. Install it under C:\Progs (Adjust at will, but I didn't try a path with a space in it)

Now we need the library. If you let Alien::wxWidgets download and build it, it won't patch it to have it embed the manifest files into the DLL files, causing DLL errors and malfunctions when you try to some aspects of Wx. I could patch Alien::wxWidgets to patch wxWidget's makefile, but I decide to just patch wxWidget's makefile. That means the patches Alien::wxWidgets wants to apply [1] [2] won't get applied.

  1. Download wxWidgets-2.8.10
  2. Install it in C:\Progs\wxWidgets-2.8.10 (Adjust at will, but I didn't try a path with a space in it)

It might be a good idea to upgrade your Perl tool chain. You want at least:

I had the following installed:

Then, open up a console and execute the following commands in turn. As is, it's not suitable to be copy and pasted in its entirety or put in a batch file.

Note that the process takes a while. The longest step, building "msw", takes an hour or more on my aging machine.

"C:\Progs\Microsoft Visual Studio 9.0\VC\vcvarsall" C: cd \Progs\wxWidgets-2.8.10 cd build\msw nmake -f makefile.vc SHARED=1 BUILD=release cd ..\.. cd contrib\build\stc nmake -f makefile.vc SHARED=1 BUILD=release cd ..\..\.. cd lib\vc_dll for %q in (*.manifest) do ( mt -nologo -manifest %q -outputresource:%~nq;2 del %q ) cd ..\.. set WXDIR=C:\Progs\wxWidgets-2.8.10 set WXWIN=C:\Progs\wxWidgets-2.8.10 C: cd \ md stager cd stager lwp-request http://search.cpan.org/CPAN/authors/id/M/MB/MBARBON/Alien- +wxWidgets-0.47.tar.gz > Alien-wxWidgets-0.47.tar.gz perl -MArchive::Tar -e"Archive::Tar->new->read($ARGV[0],1,{extract=>1} +)" Alien-wxWidgets-0.47.tar.gz cd Alien-wxWidgets-0.47 perl -i.bak -pe"s/config => \{ cc => \$cc, ld => \K(?=\$cc })/\$cc eq +'cl' ? 'link' : /" lib\Alien\wxWidgets\Utility.pm perl Makefile.PL INSTALLDIRS=site -> Should ask "Do you want to fetch and build wxWidgets from source +s?". Use default "no". nmake nmake test nmake install cd .. rd /s/q Alien-wxWidgets-0.47 del Alien-wxWidgets-0.47.tar.gz lwp-request http://search.cpan.org/CPAN/authors/id/M/MB/MBARBON/Wx-0.9 +4.tar.gz > Wx-0.94.tar.gz perl -MArchive::Tar -e"Archive::Tar->new->read($ARGV[0],1,{extract=>1} +)" Wx-0.94.tar.gz cd Wx-0.94 perl -i.bak -pe"s/^sub \K(?=dynamic_lib \{$)/DELETED_/" build\Wx\build +\MakeMaker\Win32_MSVC.pm perl -i.bak -pe"s/new wxCursor\( name, \K(?=type, hsx, hsy \))/(long)/ +" xs\Cursor.xs perl Makefile.PL INSTALLDIRS=site --extra-cflags="/FIstdlib.h" nmake nmake test nmake install cd .. rd /s/q Wx-0.94 del Wx-0.94.tar.gz cd .. rd stager

Finally, you may uninstall wxWidgets-2.8.10 since Alien::wxWidgets made a copy of the files Wx needs into Perl's lib. To uninstall wxWidgets-2.8.10,

  1. Run the uninstaller found via Start | Programs, then
  2. Delete the directory C:\Progs\wxWidgets-2.8.10

Doing so will free up 500MB.


I recommend that you get Wx::Demo.

"C:\Progs\Microsoft Visual Studio 9.0\VC\vcvarsall" cpan Wx::Demo

You can launch the demo using

wperl C:\Progs\perl5101\site\bin\wxperl_demo.pl

It warns that it's "skipping module 'Wx::DemoModules::wxHVScrolledWindow'". I think it's a problem with the demo, not a problem with Wx.

Update: Many small tweaks to the text parts. Last one on Dec 22, 2009 at 10:21 EST
Update: Modified the paragraph starting with "Now we need the library". Dec 30, 2009 at 10:06 EST


In reply to Installation instructions for Wx (wxWidgets fomerly wxWindows) using ActivePerl by ikegami

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.