Skip Menu |

This queue is for tickets about the Inline-Python CPAN distribution.

Report information
The Basics
Id: 60245
Status: open
Priority: 0/
Queue: Inline-Python

People
Owner: Nobody in particular
Requestors: stefanos [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 0.36
  • 0.37
  • 0.38
Fixed in: (no value)



Subject: inline python not work on win32 systems
I am trying to install the perl-Inline-Python in windows xp (32-bit) and 7 (32--bi). I run the command "perl Makefile.PL" and the error message is on both systeme with perl v5.10.1 built for MSWin32-x86-multi-thread (activeperl from activestate) and python 2.6.5 (from python.org for windows python-2.6.5.msi 32-Bit): Using These Settings: Extra Libs: Python Lib: -LC:/Python26/libs python26.lib Includes: -IC:/Python26/include Extra Flags: none (perl Makefile.PL --help for details) Checking if your kit is complete... Looks good Writing Makefile for Inline::Python C:\Inline-Python-0.36>dmake cp Python.pm blib\lib\Inline\Python.pm cp Python.pod blib\lib\Inline\Python.pod C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONS OLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPE RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHAS ATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\" -DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCRE ATE_PERL Python.c C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONS OLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPE RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHAS ATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\" -DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCRE ATE_PERL py2pl.c py2pl.c: In function `croak_python_exception': py2pl.c:405: warning: passing arg 1 of `PyErr_Fetch' from incompatible pointer t ype py2pl.c:406: warning: passing arg 1 of `PyErr_NormalizeException' from incompati ble pointer type C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONS OLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPE RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHAS ATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\" -DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCRE ATE_PERL perlmodule.c perlmodule.c:161: warning: inconsistent dll linkage for 'PerlPkg_type', dllexpor t assumed. perlmodule.c:162: error: initializer element is not constant perlmodule.c:162: error: (near initialization for `PerlPkg_type.ob_type') perlmodule.c:361: warning: inconsistent dll linkage for 'PerlObj_type', dllexpor t assumed. perlmodule.c:362: error: initializer element is not constant perlmodule.c:362: error: (near initialization for `PerlObj_type.ob_type') perlmodule.c: In function `PerlSub_call': perlmodule.c:506: warning: passing arg 2 of `Perl_sv_2mortal' from incompatible pointer type perlmodule.c: At top level: perlmodule.c:656: warning: inconsistent dll linkage for 'PerlSub_type', dllexpor t assumed. perlmodule.c:657: error: initializer element is not constant perlmodule.c:657: error: (near initialization for `PerlSub_type.ob_type') dmake.exe: Error code 129, while making 'perlmodule.o' whats wrong? the modul works under debian linux 5 on my second system.
Please try the attached patch and report back. Comments in the code suggest that this might help. Though if it really helps, this must have been broken for more than 6 years...
Subject: windows-gcc.diff
diff --git a/perlmodule.c b/perlmodule.c index 114d703..a9d5be1 100644 --- a/perlmodule.c +++ b/perlmodule.c @@ -159,7 +159,7 @@ static char PerlPkg_type__doc__[] = /* type definition */ DL_EXPORT(PyTypeObject) PerlPkg_type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "_perl_pkg", /*tp_name*/ sizeof(PerlPkg_object), /*tp_basicsize*/ @@ -359,7 +359,7 @@ PyMappingMethods mp_methods = { /* type definition */ DL_EXPORT(PyTypeObject) PerlObj_type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "_perl_obj", /*tp_name*/ sizeof(PerlObj_object), /*tp_basicsize*/ @@ -654,7 +654,7 @@ static char PerlSub_type__doc__[] = /* type definition */ DL_EXPORT(PyTypeObject) PerlSub_type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "_perl_sub", /*tp_name*/ sizeof(PerlSub_object), /*tp_basicsize*/
its not really better with patch, see log: C:\Inline-Python-0.36>dmake Skip blib\lib\Inline\Python.pm (unchanged) Skip blib\lib\Inline\renamer.pl (unchanged) Skip blib\lib\Inline\Python.pod (unchanged) C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\"-DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCREATE_PERL Python.c C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\"-DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCREATE_PERL py2pl.c py2pl.c: In function `croak_python_exception': py2pl.c:405: warning: passing arg 1 of `PyErr_Fetch' from incompatible pointer type py2pl.c:406: warning: passing arg 1 of `PyErr_NormalizeException' from incompatible pointer type C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\"-DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCREATE_PERL perlmodule.c perlmodule.c:161: warning: inconsistent dll linkage for 'PerlPkg_type', dllexport assumed. perlmodule.c:361: warning: inconsistent dll linkage for 'PerlObj_type', dllexport assumed. perlmodule.c: In function `PerlSub_call': perlmodule.c:506: warning: passing arg 2 of `Perl_sv_2mortal' from incompatiblepointer type perlmodule.c: At top level: perlmodule.c:656: warning: inconsistent dll linkage for 'PerlSub_type', dllexport assumed. C:/Perl/site/bin/gcc.exe -c -IC:/Python26/include -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"0.36\"-DXS_VERSION=\"0.36\" "-IC:\Perl\lib\CORE" -DEXPOSE_PERL -DCREATE_PYTHON -UCREATE_PERL util.c Running Mkbootstrap for Inline::Python () C:\Perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 Python.bs dlltool --def Python.def --output-exp dll.exp C:\Perl\site\bin\g++.exe -o blib\arch\auto\Inline\Python\Python.dll -Wl,--base-file -Wl,dll.base -mdll -L"C:\Perl\lib\CORE" Python.o py2pl.o perlmodule.o util.o -Wl,--image-base,0x3f170000 C:\Perl\lib\CORE\perl510.lib C:\Python26\libs\python26.lib C:\Perl\site\lib\auto\MinGW\lib\libkernel32.a C:\Perl\site\lib\auto\MinGW\lib\libuser32.a C:\Perl\site\lib\auto\MinGW\lib\libgdi32.a C:\Perl\site\lib\auto\MinGW\lib\libwinspool.a C:\Perl\site\lib\auto\MinGW\lib\libcomdlg32.a C:\Perl\site\lib\auto\MinGW\lib\libadvapi32.a C:\Perl\site\lib\auto\MinGW\lib\libshell32.a C:\Perl\site\lib\auto\MinGW\lib\libole32.a C:\Perl\site\lib\auto\MinGW\lib\liboleaut32.a C:\Perl\site\lib\auto\MinGW\lib\libnetapi32.a C:\Perl\site\lib\auto\MinGW\lib\libuuid.a C:\Perl\site\lib\auto\MinGW\lib\libws2_32.a C:\Perl\site\lib\auto\MinGW\lib\libmpr.a C:\Perl\site\lib\auto\MinGW\lib\libwinmm.a C:\Perl\site\lib\auto\MinGW\lib\libversion.a C:\Perl\site\lib\auto\MinGW\lib\libodbc32.a C:\Perl\site\lib\auto\MinGW\lib\libodbccp32.a C:\Perl\site\lib\auto\MinGW\lib\libcomctl32.a C:\Perl\site\lib\auto\MinGW\lib\libmsvcrt.a dll.exp Python.o:Python.c:(.text+0x69): undefined reference to `_imp__newPerlPkg_object' Python.o:Python.c:(.text+0x279): undefined reference to `_imp__PyFunction_Type' Python.o:Python.c:(.text+0x290): undefined reference to `_imp__PyClass_Type' Python.o:Python.c:(.text+0x483): undefined reference to `_imp__PyFunction_Type' Python.o:Python.c:(.text+0x1323): undefined reference to `_imp__PyInstance_Type' py2pl.o:py2pl.c:(.text+0x4e): undefined reference to `_imp___Py_NoneStruct' py2pl.o:py2pl.c:(.text+0x5d): undefined reference to `_imp__PerlObj_type' py2pl.o:py2pl.c:(.text+0x69): undefined reference to `_imp__PerlSub_type' py2pl.o:py2pl.c:(.text+0x7f): undefined reference to `_imp__PyInstance_Type' py2pl.o:py2pl.c:(.text+0xb6): undefined reference to `_imp__PyFunction_Type' py2pl.o:py2pl.c:(.text+0x84b): undefined reference to `_imp__newPerlObj_object' py2pl.o:py2pl.c:(.text+0x90e): undefined reference to `_imp___Py_NoneStruct' py2pl.o:py2pl.c:(.text+0xaeb): undefined reference to `_imp__newPerlSub_object' py2pl.o:py2pl.c:(.text+0xca0): undefined reference to `_imp___Py_NoneStruct' py2pl.o:py2pl.c:(.text+0xca7): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x134): undefined reference to `_imp__PyExc_MemoryError' perlmodule.o:perlmodule.c:(.text+0x329): undefined reference to `_imp__PyExc_MemoryError' perlmodule.o:perlmodule.c:(.text+0x4e2): undefined reference to `_imp__PyExc_TypeError' perlmodule.o:perlmodule.c:(.text+0x704): undefined reference to `_imp__PyExc_KeyError' perlmodule.o:perlmodule.c:(.text+0x989): undefined reference to `_imp__PyExc_MemoryError' perlmodule.o:perlmodule.c:(.text+0xa44): undefined reference to `_imp__get_perl_pkg_subs' perlmodule.o:perlmodule.c:(.text+0xb08): undefined reference to `_imp__perl_pkg_exists' perlmodule.o:perlmodule.c:(.text+0xc3b): undefined reference to `_imp__get_perl_pkg_subs' perlmodule.o:perlmodule.c:(.text+0xcf0): undefined reference to `_imp__PyExc_KeyError' perlmodule.o:perlmodule.c:(.text+0x1408): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x1410): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x19d9): undefined reference to `_imp__PyExc_AttributeError' perlmodule.o:perlmodule.c:(.text+0x1ae7): undefined reference to `_imp__PyExc_AttributeError' perlmodule.o:perlmodule.c:(.text+0x1b25): undefined reference to `_imp__PyExc_TypeError' perlmodule.o:perlmodule.c:(.text+0x1da3): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x2066): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x206e): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x20c3): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x20cb): undefined reference to `_imp___Py_NoneStruct' perlmodule.o:perlmodule.c:(.text+0x2118): undefined reference to `_imp__PyType_Type' util.o:util.c:(.text+0x338): undefined reference to `_imp___Py_NoneStruct' util.o:util.c:(.text+0x3c1): undefined reference to `_imp___Py_TrueStruct' collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Inline\Python\Python.dll'
I'd argue that the patch did help. At least it fixed your compilation problem. Unfortunately I do not have much of an idea what to do about that linker error. I do not have access to a Windows box and have no experience there. But looking on Google for "undefined reference to `_imp___Py_NoneStruct'" turns up some results that might help. Seems like a problem that happens to other Python extensions as well.
Windows 7 can be downloaded from microsoft as trialversion and be run under Linux, Unix/Solaris or Mac (example: virtualbox) for testing Inline Python on windows. Unfortunately i have no clue whats wrong with windows, if its either the Linker or something similiar ( if you test it under windows please include a short list of needed things like „perl 5.10, python 2.6, mingw/nmake/visual c++/studio as example including the needed librarys)“). A search via google didnt reveal anything useful. I can for a period of time offer a Windows box (including a windows xp sp2 valid license) if you need this. A Laptop can be included. Virtualbox http://www.virtualbox.org/wiki/Downloads Windows 7 Enterprise 90-day Trial (10 days without activate): http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx?ITPID=wtcfeed ActivePerl http://www.activestate.com/activeperl/downloads Strawberryperl http://strawberryperl.com/
it works with few changes with mingw (with GCC 3.4.5) in the Makefile.PL on win32 One Problem is the problem from the win32 python installer for path on cmd and follow command help: (the python.org win32 install not set the path) set Path=%Path%;C:\Python26 (or Python25 / Python27) The first Problem is "python.exe" not "python" on win32. Change in Makefile.PL the line $p .= "/python"; to $p .= $^O eq 'MSWin32' ? "/python.exe" : "/python"; The second Problem is Mingw need the libpython*.a (mingw lib) not python*.lib (VC++ import lib, C89 only). It es enough to add one line under @py_libs (Win32 support) as first line for win32 for automatic install with mingw (cpan install with auto answers, maybe check for dmake): 'C:/Python*/libs/libpython*.a', and after that your lines 'C:/Python*/libs/python*.lib', then work it with ActivePerl (5.10 and 5.12 with mingw, ppm install mingw) and the Python 2.6/2.7 from python.org for win32. Special thanks to Ronald Blaschke (rblasch.org) for the help.