Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Installation instructions for Wx (wxWidgets fomerly wxWindows) using ActivePerl

by ikegami (Pope)
on Dec 22, 2009 at 02:14 UTC ( #813799=perlmeditation: print w/ replies, xml ) Need Help??

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

Comment on Installation instructions for Wx (wxWidgets fomerly wxWindows) using ActivePerl
Select or Download Code
Re: Installation instructions for Wx (wxWdgets fomerly wxWindows) using ActivePerl
by flamey (Scribe) on Dec 28, 2009 at 13:39 UTC

    I'm getting error while making Alien-wxWidgets:

    C:\stager\Alien-wxWidgets-0.47>nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe Build --makefile_env_macros 1 Subroutine version::qv redefined at inc/version.pm line 22. Building Alien-wxWidgets Configuration error: could not find libraries for configuration: '' '2 +8' at inc/ My/Build/Win32.pm line 77. NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0xff' Stop. C:\stager\Alien-wxWidgets-0.47>

    Am I missing some Perl Modules? Or something didn't build right in the previous steps? (I wasn't watching each line, but I didn't see any errors with a quick overview after each step)

        I doubt that it will help, but if you want to try 0.48, skip the following step of the OP:

        perl -i.bak -pe"s/config => \{ cc => \$cc, ld => \K(?=\$cc })/\$cc eq +'cl' ? 'link' : /" lib\Alien\wxWidgets\Utility.pm

        The only difference between 0.47 and 0.48 is a fix that addresses the same problem as the patch applied by that step.

      Make sure that WXDIR and/or WXWIN were set correctly.

      If that's not it, then I don't know, and I don't feel like wrangling with that installer again.

Re: Installation instructions for Wx (wxWdgets fomerly wxWindows) using ActivePerl
by ambrus (Abbot) on Dec 30, 2009 at 12:33 UTC

    Wx is a pain to install on any platform.

      Very insightful and helpful comment
Re: Installation instructions for Wx (wxWidgets fomerly wxWindows) using ActivePerl (update)
by ikegami (Pope) on Apr 20, 2010 at 06:11 UTC

    I got in touch with the maintainer of Wx after writing the OP. Save for the incompatibility with VS6, all the issues listed in the OP have been resolved.

    I have just successfully installed Wx using the following procedure:

    1. Download "Visual C++ 2008 Express edition".
    2. Install it under C:\Progs (Or wherever you want. This is where I installed it.)
    3. "C:\Progs\Microsoft Visual Studio 9.0\VC\vcvarsall"
    4. cpan Alien::wxWidgets (You can surely skip this step as it should be done by the next.)
    5. cpan Wx
    6. cpan Wx::Demo (optional)

    My Perl:

    • ActivePerl 5.12.0 build 1200

    My build environment:

    The versions installed:

      ikegami: I am trying to install WxPerl, according to your instructions. I have Strawberry Perl 5.14.2 running on Windows 7.

      I tried to install VC++ 2008, but it's not available, so I installed VC++ 2010 (I don't think it should be a problem (?)).

      Then I went:

      cpan Wx

      It seems to have installed:

      SMUELLER/ExtUtils-ParseXS-3.18.tar.gz

      OK (it printed hundreds of lines, so I'm not attaching it here, unless necessary); then it went ahead to:

       CPAN.pm: Building M/MD/MDOOTSON/Wx-0.9917.tar.gz

      and after many lines looking ok, eventually issued the following error:

      ... cp lib/Wx/Menu.pm blib\lib\Wx\Menu.pm cp build/Wx/build/MakeMaker/Win32_MSVC.pm blib\lib\Wx\build\MakeMaker\ +Win32_MSVC.pm cp build/Wx/build/MakeMaker/Win32.pm blib\lib\Wx\build\MakeMaker\Win32 +.pm cp Wx.pm blib\lib\Wx.pm D:\MyPrograms\Technical\Perl\Dwimperl\perl\bin\perl.exe script/wxperl_ +overload cpp\ovl_const.cpp cpp\ovl_const.h overload.lst Writing 'cpp\ovl_const.h'. Writing 'cpp\ovl_const.cpp'. D:\MyPrograms\Technical\Perl\Dwimperl\perl\bin\perl.exe -MExtUtils::Co +mmand -e touch -- wxt_overload cp lib/Wx/PerlTest.pm ..\..\blib\lib\Wx\PerlTest.pm dmake: Error: -- `D:\MyPrograms\Technical\Perl\Dwimperl\perl\lib\ExtU +tils\xsubpp' not found, and can't be made dmake: Error code 255, while making 'subdirs' dmake.EXE: Error code 255, while making 'subdirs' MDOOTSON/Wx-0.9917.tar.gz D:\MyPrograms\Technical\Perl\Dwimperl\c\bin\dmake.EXE -- NOT OK Running make install Make had returned bad status, install seems impossible

      What to do?

      Many TIA - Helen

        Strawberry already has a C compiler, so I'm not sure you needed to install another one.

        "dmake: Error: -- `D:\MyPrograms\Technical\Perl\Dwimperl\perl\lib\ExtUtils\xsubpp' not found, and can't be made"

        Try:

        cpan ExtUtils::ParseXS

        Update: If you're actually using DWIM perl it claims to ship with Wx already installed: README.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://813799]
Approved by ww
Front-paged by keszler
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2014-08-01 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (258 votes), past polls