error installing wxperl via strawberry perl

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
j.dr4242
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Feb 03, 2022 6:36 pm

error installing wxperl via strawberry perl

Post by j.dr4242 »

I get the following install error using 'cpan -i wX'. I have strawberry perl 5.32.1.1 which uses gcc 8.3.0. Any clues?

Code: Select all

"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Html.xsc Html.c
g++  -m64  -O2 -mthreads -m64 -Os   -c -I. -I.. -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\lib -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include -I. -I. -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\lib -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include  -I. -I..\.. -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\lib -IC:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\"  "-IC:\STRAWB~1\perl\lib\CORE" -DWXPL_EXT -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -DWXUSINGDLL -DNOPCH -DNO_GCC_PRAGMA   -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -DWXUSINGDLL -DNOPCH -DNO_GCC_PRAGMA    -DWXPL_EXT -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -DWXUSINGDLL -DNOPCH -DNO_GCC_PRAGMA   Html.c
In file included from ..\../cpp/wxapi.h:57,
                 from Html.c:23:
C:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include/wx/hashmap.h: In static member function 'static void** _wxHashTableBase2::AllocTable(size_t)':
C:\STRAWB~1\perl\lib\CORE/perl.h:175:16: error: 'my_perl' was not declared in this scope
 #  define aTHX my_perl
                ^~~~~~~
C:\STRAWB~1\perl\lib\CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX'
 #    define vTHX aTHX
                  ^~~~
C:\STRAWB~1\perl\lib\CORE/embedvar.h:54:19: note: in expansion of macro 'vTHX'
 #define PL_Mem   (vTHX->IMem)
                   ^~~~
C:\STRAWB~1\perl\lib\CORE/iperlsys.h:818:4: note: in expansion of macro 'PL_Mem'
  (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
    ^~~~~~
C:\STRAWB~1\perl\lib\CORE/XSUB.h:612:33: note: in expansion of macro 'PerlMem_calloc'
 #    define calloc              PerlMem_calloc
                                 ^~~~~~~~~~~~~~
C:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include/wx/hashmap.h:121:25: note: in expansion of macro 'calloc'
         return (void **)calloc(sz, sizeof(void*));
                         ^~~~~~
C:\STRAWB~1\perl\lib\CORE/perl.h:175:16: note: suggested alternative: 'my_fork'
 #  define aTHX my_perl
                ^~~~~~~
C:\STRAWB~1\perl\lib\CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX'
 #    define vTHX aTHX
                  ^~~~
C:\STRAWB~1\perl\lib\CORE/embedvar.h:54:19: note: in expansion of macro 'vTHX'
 #define PL_Mem   (vTHX->IMem)
                   ^~~~
C:\STRAWB~1\perl\lib\CORE/iperlsys.h:818:4: note: in expansion of macro 'PL_Mem'
  (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
    ^~~~~~
C:\STRAWB~1\perl\lib\CORE/XSUB.h:612:33: note: in expansion of macro 'PerlMem_calloc'
 #    define calloc              PerlMem_calloc
                                 ^~~~~~~~~~~~~~
C:\Strawberry\perl\site\lib\Alien\wxWidgets\msw_3_0_2_uni_gcc_3_4\include/wx/hashmap.h:121:25: note: in expansion of macro 'calloc'
         return (void **)calloc(sz, sizeof(void*));
                         ^~~~~~
gmake[2]: *** [Makefile:343: Html.o] Error 1
gmake[2]: Leaving directory 'C:/STRAWB~1/cpan/build/Wx-0.9932-0/ext/html'
gmake[1]: *** [Makefile:499: subdirs] Error 2
gmake[1]: Leaving directory 'C:/STRAWB~1/cpan/build/Wx-0.9932-0/ext'
gmake: *** [Makefile:649: subdirs] Error 2
  MDOOTSON/Wx-0.9932.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'M/MD/MDOOTSON/Wx-0.9932.tar.gz'.
Last edited by DavidHart on Thu Feb 03, 2022 7:24 pm, edited 1 time in total.
Reason: Added code-tags
xx
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Jun 17, 2022 6:21 am

Re: error installing wxperl via strawberry perl

Post by xx »

hello, I am also learning Perl and encountered the same problem installing various modules from CPAN (not only Wx but also Tk and others) in 2022.

For me, the problem was multiple C bin locations in the OS's path conflicting in Perl MAKE steps.
Maybe this might help you.

Solution:

-Make sure you don't have any other C binaries that interferes with the perl C binaries in the env var PATH (both system and user version).

Steps:
- Move the perl directories to the top of the PATH environment variable.
*note: your path name to strawberry perl might differ depending on where you installed it*

(for me, the names of the directories were:
------ "C:\Strawberry\c\bin"
------ "C:\Strawberry\perl\bin"
------ "C:\Strawberry\perl\site\bin"
)

(only do this if the first step doesn't solve the problem)
-Remove other C compilers and other conflicting binaries from the Path environment variable
*note: again the direcotries might be different to you depending on which binaries are confliciting with perl*

(for me, those were:
------ "C:\TDM-GCC-compiler"
------ "C:\GCC-compiler"
)

-Close the shell and open a new shell for the changes to take effect

After that I was able to install the modules from CPAN again without compilation errors.
Post Reply