1

I am trying to run Perl code generated using wxGlade but I am receiving this error

error.

In text

Can't load 'C:/Perl/site/lib/auto/Wx/Wx.dll' for module Wx: load_file:The specified module could not be found at C:/Perl/lib/Dynaloader.pm line 191.

Ultimately, I want to rearrange widgets using the code generated from wxGlade. I don't have the *.wxg file, I only have the Perl code.

If this is not possible, I want to see the widgets when the Perl code runs then I will re-create the widgets in wxGlade.

I'm using ActivePerl 5.16.3 Build 1604 on Windows 10. I have installed wxPerl Version 0.9921.

Here's the result of where perl

C:\Windows\system32>where perl
C:\Perl\bin\perl.exe
C:\strawberry\perl\bin\perl.exe

Below is the result of the cpan Wx command.

C:\Windows\system32>cpan Wx
Set up gcc environment - 4.4.3
CPAN: Term::ANSIColor loaded ok (v4.02)
CPAN: Storable loaded ok (v2.45)
Reading 'C:\Perl\cpan\Metadata'
  Database was generated on Mon, 04 Dec 2017 06:54:07 GMT
Running install for module 'Wx'
Running make for M/MD/MDOOTSON/Wx-0.9932.tar.gz
CPAN: Digest::SHA loaded ok (v5.85)
CPAN: Compress::Zlib loaded ok (v2.063)
Checksum for C:\Perl\cpan\sources\authors\id\M\MD\MDOOTSON\Wx-0.9932.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.96)
Wx-0.9932/
Wx-0.9932/build/
Wx-0.9932/build/Wx/
Wx-0.9932/build/Wx/build/
Wx-0.9932/build/Wx/build/MakeMaker/
Wx-0.9932/build/Wx/build/MakeMaker/Any_OS.pm
Wx-0.9932/build/Wx/build/MakeMaker/Any_wx_config.pm
Wx-0.9932/build/Wx/build/MakeMaker/Core.pm
Wx-0.9932/build/Wx/build/MakeMaker/Hacks.pm
Wx-0.9932/build/Wx/build/MakeMaker/MacOSX_GCC.pm

Wx-0.9932/XS/SVGFileDC.xsp
Wx-0.9932/XS/TaskBarIcon.xs
Wx-0.9932/XS/TextAttr.xsp
Wx-0.9932/XS/TextCtrl.xsp
Wx-0.9932/XS/TextCtrlIface.xsp
Wx-0.9932/XS/TextEntryDialog.xs
Wx-0.9932/XS/Timer.xs
Wx-0.9932/XS/ToggleButton.xs
Wx-0.9932/XS/ToolBar.xs
Wx-0.9932/XS/Toolbook.xsp
Wx-0.9932/XS/ToolTip.xs
Wx-0.9932/XS/TopLevelWindow.xsp
Wx-0.9932/XS/Treebook.xsp
Wx-0.9932/XS/TreeCtrl.xs
Wx-0.9932/XS/Utils.xs
Wx-0.9932/XS/Validators.xs
Wx-0.9932/XS/VarHScrollHelper.xsp
Wx-0.9932/XS/VarHVScrollHelper.xsp
Wx-0.9932/XS/Variant.xsp
Wx-0.9932/XS/VarScrollHelperBase.xsp
Wx-0.9932/XS/VarVScrollHelper.xsp
Wx-0.9932/XS/VListBox.xsp
Wx-0.9932/XS/VScrolledWindow.xsp
Wx-0.9932/XS/Wave.xs
Wx-0.9932/XS/Window.xsp
Wx-0.9932/XS/Wizard.xs
CPAN: File::Temp loaded ok (v0.2304)
CPAN: Parse::CPAN::Meta loaded ok (v1.4409)
CPAN: CPAN::Meta loaded ok (v2.132830)
---- Unsatisfied dependencies detected during ----
----         MDOOTSON/Wx-0.9932.tar.gz        ----
    Alien::wxWidgets [build_requires]
Running make test
  Make had some problems, won't test
  Delayed until after prerequisites
Running make install
  Make had some problems, won't install
  Delayed until after prerequisites
Running install for module 'Alien::wxWidgets'
Running make for M/MD/MDOOTSON/Alien-wxWidgets-0.69.tar.gz
Checksum for C:\Perl\cpan\sources\authors\id\M\MD\MDOOTSON\Alien-wxWidgets-0.69.tar.gz ok
Alien-wxWidgets-0.69
Alien-wxWidgets-0.69/Build.PL
Alien-wxWidgets-0.69/Changes
Alien-wxWidgets-0.69/MANIFEST
Alien-wxWidgets-0.69/META.json

Alien-wxWidgets-0.69/patches/wxMac-2.8.10-fontdlg.patch
Alien-wxWidgets-0.69/patches/wxMac-2.8.3-brokengcc.patch
Alien-wxWidgets-0.69/patches/wxMac-2.9.0-textctrl.patch
Alien-wxWidgets-0.69/patches/wxWidgets-2.8.0-magic.patch
Alien-wxWidgets-0.69/patches/wxWidgets-2.8.10-gsocket.patch
Alien-wxWidgets-0.69/patches/wxWidgets-2.9.0-magic.patch
Alien-wxWidgets-0.69/patches/wxWidgets-2.9.0-msgdlg.patch
Alien-wxWidgets-0.69/patches/wxWidgets-2.9.4-plugin.patch
Alien-wxWidgets-0.69/patches/wxWidgets-3.0.2-webkit.patch
Alien-wxWidgets-0.69/script
Alien-wxWidgets-0.69/script/make_ppm.pl
Alien-wxWidgets-0.69/t
Alien-wxWidgets-0.69/t/01_load.t
Alien-wxWidgets-0.69/t/zy_pod_coverage.t
Alien-wxWidgets-0.69/t/zz_pod.t
CPAN: Module::CoreList loaded ok (v3.03)
CPAN: Module::Build loaded ok (v0.4203)

  CPAN.pm: Building M/MD/MDOOTSON/Alien-wxWidgets-0.69.tar.gz
    gmake: *** [gcc_mswudll\coredll_gdiplus.o] Error 1
    system: gmake -f makefile.gcc all  UNICODE=1 MSLU=0 BUILD=release SHARED=1  DEBUG_INFO=default DEBUG_FLAG=1 LDFLAGS=" -m32" CPPFLAGS="-m32 -D_USE_32BIT_TIME_T": 512 at inc/My/Build/Win32.pm line 284.
    dmake.exe:  Error code 130, while making 'all'
      MDOOTSON/Alien-wxWidgets-0.69.tar.gz
      C:\STRAWB~1\c\bin\dmake.exe -- NOT OK
    CPAN: YAML::XS loaded ok (v0.41)
    Running make test
      Can't test without successful make
    Running make install
      Make had returned bad status, install seems impossible
    Running make for M/MD/MDOOTSON/Wx-0.9932.tar.gz
    Warning: Prerequisite 'Alien::wxWidgets => 0.25' for 'MDOOTSON/Wx-0.9932.tar.gz' failed when processing 'MDOOTSON/Alien-wxWidgets-0.69.tar.gz' with 'make => NO'. Continuing, but chances to succeed are limited.
    CPAN: Time::HiRes loaded ok (v1.9726)

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

    Set up gcc environment - 4.4.3
    Checking if your kit is complete...
    Looks good
    Warning: prerequisite Alien::wxWidgets 0.25 not found.
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Socket
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DND
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::FS
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Grid
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Help
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Html
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::MDI
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Print
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::XRC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::STC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DocView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Calendar
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DateTime
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Media
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::RichText
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::AUI
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DataView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::PropertyGrid
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Ribbon
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::WebView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::PerlTest
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::IPC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::SplashFast
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::Carp
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::TextValidator
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx
    Writing MYMETA.yml and MYMETA.json

    ======================================================================
    wxWidgets minimum supported version 2.007001 is missing.
    You will need to re-run Makefile.PL after it is installed.
    You must install wxWidgets using Alien::wxWidgets.
    ======================================================================

    ======================================================================
    For installation instructions and further help please see
    docs/INSTALL.pod

    For command line switches help use:
    perl Makefile.PL --help
    ======================================================================

    Warning: Prerequisite 'Alien::wxWidgets => 0.25' for 'MDOOTSON/Wx-0.9932.tar.gz' failed when processing 'MDOOTSON/Alien-wxWidgets-0.69.tar.gz' with 'make => NO'. Continuing, but chances to succeed are limited.
    Makefile out-of-date with respect to alien_wxwidgets_missing
    Cleaning current config before rebuilding Makefile...
    C:\STRAWB~1\c\bin\dmake.exe -f Makefile.old clean > NUL
    C:\Perl\bin\perl.exe Makefile.PL "INSTALLDIRS=site"
    Set up gcc environment - 4.4.3
    Checking if your kit is complete...
    Looks good
    Warning: prerequisite Alien::wxWidgets 0.25 not found.
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Socket
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DND
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::FS
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Grid
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Help
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Html
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::MDI
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Print
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::XRC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::STC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DocView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Calendar
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DateTime
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Media
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::RichText
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::AUI
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::DataView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::PropertyGrid
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Ribbon
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::WebView
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::PerlTest
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::IPC
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::SplashFast
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::Carp
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl::TextValidator
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx::Perl
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx
    Writing MYMETA.yml and MYMETA.json
    Generating a dmake-style Makefile
    Writing Makefile for Wx
    Writing MYMETA.yml and MYMETA.json

    ======================================================================
    wxWidgets minimum supported version 2.007001 is missing.
    You will need to re-run Makefile.PL after it is installed.
    You must install wxWidgets using Alien::wxWidgets.
    ======================================================================

    ======================================================================
    For installation instructions and further help please see
    docs/INSTALL.pod

    For command line switches help use:
    perl Makefile.PL --help
    ======================================================================

    ==> Your Makefile has been rebuilt. <==
    ==> Please rerun the C:\STRAWB~1\c\bin\dmake.exe command.  <==
    C:\Perl\bin\perl.exe  -e "exit 1" --
    dmake.exe:  Error code 129, while making 'Makefile'
      MDOOTSON/Wx-0.9932.tar.gz
      C:\STRAWB~1\c\bin\dmake.exe -- NOT OK
    Running make test
      Can't test without successful make
    Running make install
      Make had returned bad status, install seems impossible

I removed ActivePerl and used Strawberry Perl. I issued cpan Wx then I got the error below.

Can't locate Wx/Mini.pm in .@INC (.@INC contains:
C:\Program Files\ActiveState Komodo IDE 9\lib\support\dbgp\perllib
C:/strawberry/perl/site/lib/MSWin32-x86-multi-thread
C:/strawberry/perl/site/lib
C:/strawberry/perl/vendor/lib
C:/strawberry/perl/lib .)
at C:/strawberry/perl/lib/Wx.pm line 100.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/Wx.pm line 100.

mini.pm can be found in C:\strawberry\cpan\build\Wx-0.9932-zlzpbD\lib\Wx

Borodin
  • 126,100
  • 9
  • 70
  • 144
Matt
  • 15
  • 4
  • 1
    You have installed *wxPerl* wrongly. It cannot have passed its own tests. – Borodin Dec 03 '17 at 10:41
  • 1
    Please don't post images of text on this site. – Borodin Dec 03 '17 at 10:51
  • 1
    Are you using *ActivePerl*, *Strawberry Perl*, or something else? What versions of `Wx` and `Alien::wxWidgets` do you have? – Borodin Dec 03 '17 at 10:57
  • Apologies but what do you mean I have installed wxPerl wrongly? I'm using ActivePerl 5.16.3 Build 1604 on Windows 10. I have installed Wx Version 0.9921. I'm using Alien-wxWidgets Version 0.65 – Matt Dec 03 '17 at 12:08
  • Please tag your messages with e.g. `@Borodin` so that I get a notification when you write to me. The file `Wx.dll` is part of the `Wx` installation, but `Dynaloader` is unable to find it. Does `C:\Perl\site\lib\auto\Wx\Wx.dll` exist? If so then you have probably installed it using a different account. Did you install using `ppm`, `cpan`, or something else? – Borodin Dec 03 '17 at 12:20
  • @Borodin - I installed using Activeperl's Perl Package Manager GUI. I am only using one account. Yes, C:\Perl\site\lib\auto\Wx\Wx.dll does exist. – Matt Dec 03 '17 at 12:45
  • 1
    That's very odd. I just installed the latest `Wx` using `cpan`, and there is no `Wx.dll` at all. It is called `Wx.xs.dll`, and all the libraries built from XS code have the same naming convention. All I can suggest is to use `cpan` to reinstall the module. That way you will get a newer version as well. – Borodin Dec 03 '17 at 17:21
  • @Borodin - I installed Wx using cpan Wx command in Windows Shell. Error is now "Can’t locate Wx.pm in .@INC (.@INC contains: C:/Perl/site/lib C:/Perl/lib .).". I checked the said path and there is no Wx.pm in either of those 2 folders. So I wonder what has been happening with the Wx installation. Also, Wx folder does not exist in folder C:\Perl\site\lib\auto I want to show the result of installation but I don't know how to attach text file here. – Matt Dec 04 '17 at 13:21
  • What does `where perl` show? – Borodin Dec 04 '17 at 13:24
  • Copy and paste the log into your question; select it and hit Ctrl-K – Borodin Dec 04 '17 at 13:25
  • @Borodin - Here's the result of `where perl` C:\Windows\system32>where perl C:\Perl\bin\perl.exe C:\strawberry\perl\bin\perl.exe – Matt Dec 04 '17 at 13:51
  • Then you're almost certainly installing modules under the wrong perl instance. You need to remove one or the other to be safe, as Windows' behaviour is affected both by file associations and the `PATH` environment variable, unlike Linux. You could take a look at [`berrybrew`](http://blogs.perl.org/users/steve_bertrand/2016/07/berrybrew-the-perlbrew-for-windows-rewritten-and-enhanced.html) but I don't know whether it will work with ActivePerl. I generally prefer Strawberry Perl for Windows as it is less tied to proprietary systems. – Borodin Dec 04 '17 at 14:17

1 Answers1

1

Your log shows

Make had returned bad status, install seems impossible

so the installation failed and you have no Wx. You will also see that the build is trying to use both dmake (Strawberry Perl) and gmake (Active Perl), and it references both perl instances here

C:\STRAWB~1\c\bin\dmake.exe -f Makefile.old clean > NUL
C:\Perl\bin\perl.exe Makefile.PL "INSTALLDIRS=site"

so it's getting mightily confused

You need to remove one or the other to be safe, as Windows' behaviour is affected both by file associations and the PATH environment variable, unlike Linux.

You could take a look at berrybrew but I don't know whether it will work with ActivePerl.

I generally prefer Strawberry Perl for Windows as it is less tied to proprietary systems.

Borodin
  • 126,100
  • 9
  • 70
  • 144
  • I removed Activeperl and used Strawberry Perl. I issued cpan Wx then I got the error below. Can't locate Wx/Mini.pm in .@INC (.@INC contains: C:\Program Files\ActiveState Komodo IDE 9\lib\support\dbgp\perllib C:/strawberry/perl/site/lib/MSWin32-x86-multi-thread C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .) at C:/strawberry/perl/lib/Wx.pm line 100. BEGIN failed--compilation aborted at C:/strawberry/perl/lib/Wx.pm line 100. mini.pm it can be found in C:\strawberry\cpan\build\Wx-0.9932-zlzpbD\lib\Wx – Matt Dec 05 '17 at 13:43
  • The Mini.pm does exist so I wonder why I am getting error that it cannot be found. – Matt Dec 07 '17 at 04:14
  • @Matt: Where did you find `Mini.pm`? Did the `cpan` installation succeed? – Borodin Dec 07 '17 at 10:37
  • It can be found in `C:\strawberry\perl\lib\Wx`. Yes, `cpan` installation succeeded. The error in `use Wx 0.15 qw[:allclasses];` is now: `Bareword “XXXDLLSXXX” not allowed while “strict subs” in use at C:/strawberry/perl/lib/Wx/Mini.pm line 12. Compilation failed in require at C:/strawberry/perl/lib/Wx.pm line 100. BEGIN failed—compilation aborted at C:/strawberry/perl/lib/Wx.pm line 100. Compilation failed in require.` – Matt Dec 07 '17 at 13:50
  • @Matt: That error message means you have skipped an essential part of the installation process. What hacking did you do to get rid of the `Can't locate Wx/Mini.pm` error? Presumably you copied it into place from the distribution? No one told you to do that, and it just hampers our efforts to help you get the module installed. What makes you think `cpan Wx` worked correctly? It's pretty certain that it didn't. How did you remove ActivePerl? I think you should open a new question and be more careful about following instructions. – Borodin Dec 07 '17 at 14:07
  • I ran the `cpan Wx` command again and I did not see any error on the command shell thus I presumed successful installation. I copied Wx.pm from `C:\strawberry\cpan\build\Wx-0.9932-zlzpbD` to `C:\strawberry\perl\lib` because Perl is looking for it. After that, `Can't locate Wx/Mini.pm` error appeared. I copied it because I thought that will solve the problem. I uninstalled ActivePerl from Add/Remove Program. Before I open new question, what can you suggest to install Wx correctly? – Matt Dec 07 '17 at 14:44
  • @Matt: You can't in general "install" a module by copying files around. That's why there's an installation procedure. If you've copied `Wx.pm` as well as `Wx/Mini.pm` then there's no way forward. Delete the `lib/Wx` directory and the `lib/Wx.pm` file, as well as the `C:\strawberry\cpan\build\Wx-0.9932-zlzpbD` directory. Then start `cpan` to get the `cpan>` prompt, and type `force install Wx`. It's a big module so it takes several minutes. If it's still not working then post a new question. Don't hack anything else. – Borodin Dec 07 '17 at 14:55
  • I uninstalled ActiveState Perl. After that, I reinstalled Strawberry Perl and WxWidgets then I installed Wx using cpan. I can now run the Perl code generated from WxGlade. Thanks for your suggestion not to mix up ActiveState and Strawberry Perl. – Matt Jan 01 '18 at 13:41