|
From: Fabrizio B. <ext...@gm...> - 2015-02-12 10:30:17
|
HI all, I'm struggling with this since days but no clue at all. My C++ application compiles against Python27.dll successfully on windows 32 with mingw 32 but on the 64 bit something is not working properly at runtime . I've installed python-2.7.9.amd64.msi and the mingw 64 compiler is: $ g++ --version g++.exe (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 4.9.2 No errors while Compiling and linking so I get my executables but when I try to execute my Application I get: Cannot find entry point _PyArg_Parse in dynamic link library in python27.dll Any clue or similar experiences would be really appreciated. thanks in advance -- Fab |
|
From: Paul M. <p.f...@gm...> - 2015-02-12 10:53:26
|
On 12 February 2015 at 10:30, Fabrizio Buratta <ext...@gm...> wrote: > No errors while Compiling and linking so I get my executables but when I try > to execute my Application I get: > > Cannot find entry point _PyArg_Parse in dynamic link library in python27.dll > > Any clue or similar experiences would be really appreciated. The libpython27.a file as shipped with 64-bit Python 2.7 is the one for 32-bit builds. This is http://bugs.python.org/issue23199 - if you read that bug report, it has details on how to regenerate the file for 64-bit. Paul |
|
From: Gisle V. <gv...@ya...> - 2015-02-12 14:50:01
|
Fabrizio Buratta wrote: > My C++ application compiles against Python27.dll successfully on windows 32 with mingw 32 but > on the 64 bit something is not working properly at runtime . > > I've installed python-2.7.9.amd64.msi > > and the mingw 64 compiler is: > > $ g++ --version > g++.exe (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 4.9.2 > > No errors while Compiling and linking so I get my executables but when I try to execute my Application I get: > > Cannot find entry point _PyArg_Parse in dynamic link library in python27.dll You perhaps have 2 competing python27.dll files in you PATH? I got the same problem after installing TDM-gcc. It included an 64-bit python27.dll ahead of my %PYTHONHOME\python27.dll (32-bit) pedump2 %PYTHONHOME\python27.dll %MINGW_TDM\bin\python27.dll | grep "Machine:" Machine: 014C (i386) Machine: 8664 (x64) TDMgcc-MingW's gdb uses python so TDM distributes them: http://tdm-gcc.tdragon.net PEdump2 is my effort to up update Matt Pietrek's almost 20 years original to support 64-bit modules: http://www.watt-32.net/misc/pe-dump2.zip -- --gv |
|
From: Fabrizio B. <ext...@gm...> - 2015-02-12 15:43:39
|
2015-02-12 15:37 GMT+01:00 Gisle Vanem <gv...@ya...>: > You perhaps have 2 competing python27.dll files in you PATH? > I got the same problem after installing TDM-gcc. It included > an 64-bit python27.dll ahead of my %PYTHONHOME\python27.dll (32-bit) > > pedump2 %PYTHONHOME\python27.dll %MINGW_TDM\bin\python27.dll | grep > "Machine:" > Machine: 014C (i386) > Machine: 8664 (x64) > > TDMgcc-MingW's gdb uses python so TDM distributes them: > http://tdm-gcc.tdragon.net > > PEdump2 is my effort to up update Matt Pietrek's almost 20 years > original to support 64-bit modules: > http://www.watt-32.net/misc/pe-dump2.zip > thank you very much, I will try this ASAP -- Fab |
|
From: Fabrizio B. <ext...@gm...> - 2015-02-12 14:57:48
|
2015-02-12 11:53 GMT+01:00 Paul Moore <p.f...@gm...>: > The libpython27.a file as shipped with 64-bit Python 2.7 is the one > for 32-bit builds. This is http://bugs.python.org/issue23199 - if you > read that bug report, it has details on how to regenerate the file for > 64-bit. > thank for replying. yes I tried this but still have my app crashing . Actually generating python27.dll from the definition with dlltools.exe gets rid of that message but still the application is not able to execute. it crashes and I'm not able to debug it, windows doesn't tell me anything -- Fab |
|
From: Paul M. <p.f...@gm...> - 2015-02-12 15:36:45
|
On 12 February 2015 at 14:57, Fabrizio Buratta <ext...@gm...> wrote: > 2015-02-12 11:53 GMT+01:00 Paul Moore <p.f...@gm...>: >> >> The libpython27.a file as shipped with 64-bit Python 2.7 is the one >> for 32-bit builds. This is http://bugs.python.org/issue23199 - if you >> read that bug report, it has details on how to regenerate the file for >> 64-bit. > > thank for replying. yes I tried this but still have my app crashing . Sorry, I misread your post - you're writing a C++ application that embeds Python, which is a different scenario, so the advice in that bug report may well be inappropriate. > Actually generating > python27.dll from the definition with dlltools.exe gets rid of that message > but still the application is not able to execute. There's no way you should be generating python27.dll. That's the Python interpreter core - did you mean that, or did you mean that you regenerated libpython27.a? > it crashes and I'm not able to debug it, windows doesn't tell me anything If it links but then crashes, that strikes me as implying that you're mixing calling conventions somehow. You may need to specify __stdcall and extern "C" linkage somehow. Sorry I can't be more specific, but I know you can get some nasty conflicts if you're not careful. One thought - you are linking to the correct MSVC runtime? Python 2.7 uses Visual Studio 2008, and links to MSVCR90.dll. If you use a different C runtime, you could quite likely get crashes. Paul |
|
From: Fabrizio B. <ext...@gm...> - 2015-02-12 15:46:25
|
2015-02-12 16:36 GMT+01:00 Paul Moore <p.f...@gm...>: > There's no way you should be generating python27.dll. That's the > Python interpreter core - did you mean that, or did you mean that you > regenerated libpython27.a? > > yes doing this into msys: gendef - python27.dll > mingwlib.def dlltool --dllname python27.dll --def mingwlib.def --output-lib amd64\libpython27.a -m i386:x86-64 > > it crashes and I'm not able to debug it, windows doesn't tell me anything > > If it links but then crashes, that strikes me as implying that you're > mixing calling conventions somehow. You may need to specify __stdcall > and extern "C" linkage somehow. Sorry I can't be more specific, but I > know you can get some nasty conflicts if you're not careful. > > One thought - you are linking to the correct MSVC runtime? Python 2.7 > uses Visual Studio 2008, and links to MSVCR90.dll. If you use a > different C runtime, you could quite likely get crashes. > I will check this, I can't now but I'll try ASAP. Thanks again -- Fab |
|
From: Eli Z. <el...@gn...> - 2015-02-12 15:50:31
|
> Date: Thu, 12 Feb 2015 11:30:10 +0100 > From: Fabrizio Buratta <ext...@gm...> > > My C++ application compiles against Python27.dll successfully on windows 32 > with mingw 32 but > on the 64 bit something is not working properly at runtime . > > I've installed python-2.7.9.amd64.msi > > and the mingw 64 compiler is: > > $ g++ --version > g++.exe (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 4.9.2 > > No errors while Compiling and linking so I get my executables but when I try to > execute my Application I get: > > Cannot find entry point _PyArg_Parse in dynamic link library in python27.dll Is python27.dll a 64-bit DLL or a 32-bit DLL? Also note the SysWOW64 vs System32 gotcha: if you look at System32 directory with 32-bit tools, Windows might fool you by redirecting to SysWOW64 instead. Finally, isn't Python compiled using MSVC? That could present problems when linking with MinGW programs, particularly in C++. Specifically, AFAIK MinGW64 doesn't generate leading underscores for symbols. |
|
From: Fabrizio B. <ext...@gm...> - 2015-02-12 16:20:59
|
2015-02-12 16:50 GMT+01:00 Eli Zaretskii <el...@gn...>: > Is python27.dll a 64-bit DLL or a 32-bit DLL? > > 64 bit ( PE32+ ) but the libpython27.a provided by the latest 2.7.9 amd64 installer is 32 bits, plus it seems strange that the 64 bit python.dll size is much smaller than 32 bits. > Also note the SysWOW64 vs System32 gotcha: if you look at System32 > directory with 32-bit tools, Windows might fool you by redirecting to > SysWOW64 instead. > > Finally, isn't Python compiled using MSVC? That could present > problems when linking with MinGW programs, particularly in C++. > Specifically, AFAIK MinGW64 doesn't generate leading underscores for > symbols. > I don't know actually it Python was natively built on MinGW , it should be built using MSVC anyway. Nonetheless I have the "same" configuration for a win 32 bit and it works. -- Fab |
|
From: Gisle V. <gv...@ya...> - 2015-02-12 16:50:31
|
Eli Zaretskii wrote: > Also note the SysWOW64 vs System32 gotcha: if you look at System32 > directory with 32-bit tools, Windows might fool you by redirecting to > SysWOW64 instead. For 32-bit programs, the pseudo-directory '%WinDir%\sysnative' dir (on Win-7/8) seems to contain all (?) files. All the .sys-files can be read with tools we're used to from Win-XP. You cannot do that for files under c:\Windows\SysWOW64. E.g.: pedump2 c:\Windows\Sysnative\drivers\npf.sys works fine. (NPF.sys is the driver for WinPcap) -- --gv |
|
From: Eli Z. <el...@gn...> - 2015-02-12 16:37:05
|
> Date: Thu, 12 Feb 2015 17:20:53 +0100 > From: Fabrizio Buratta <ext...@gm...> > > Finally, isn't Python compiled using MSVC? That could present > problems when linking with MinGW programs, particularly in C++. > Specifically, AFAIK MinGW64 doesn't generate leading underscores for > symbols. > > I don't know actually it Python was natively built on MinGW , it should be > built using MSVC anyway. > > Nonetheless I have the "same" configuration for a win 32 bit and it works. That doesn't necessarily mean too much, since the issues are different. |
|
From: Alexpux <al...@gm...> - 2015-02-12 16:52:19
|
> 12 февр. 2015 г., в 13:30, Fabrizio Buratta <ext...@gm...> написал(а): > > HI all, > > I'm struggling with this since days but no clue at all. > > My C++ application compiles against Python27.dll successfully on windows 32 with mingw 32 but > on the 64 bit something is not working properly at runtime . > > I've installed python-2.7.9.amd64.msi > > and the mingw 64 compiler is: > > $ g++ --version > g++.exe (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 4.9.2 > > No errors while Compiling and linking so I get my executables but when I try to execute my Application I get: > > Cannot find entry point _PyArg_Parse in dynamic link library in python27.dll > > Any clue or similar experiences would be really appreciated. > > thanks in advance > I see you use mingw-builds toolchain, so look into opt subfolder - it contain mingw builded python 2.7.x. You can link with it. Regards, Alexey. > -- > Fab > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe |
|
From: Eli Z. <el...@gn...> - 2015-02-12 17:06:16
|
> Date: Thu, 12 Feb 2015 17:36:35 +0100 > From: Gisle Vanem <gv...@ya...> > > Eli Zaretskii wrote: > > > Also note the SysWOW64 vs System32 gotcha: if you look at System32 > > directory with 32-bit tools, Windows might fool you by redirecting to > > SysWOW64 instead. > > For 32-bit programs, the pseudo-directory '%WinDir%\sysnative' dir > (on Win-7/8) seems to contain all (?) files. All the .sys-files can > be read with tools we're used to from Win-XP. You cannot do that for > files under c:\Windows\SysWOW64. E.g.: > pedump2 c:\Windows\Sysnative\drivers\npf.sys works fine. > > (NPF.sys is the driver for WinPcap) First, I meant *.dll files, not *.sys (I don't know what Windows does about the latter). And second, what I meant is that trying to open or even list %WinDir%\System32\foo.dll with a 32-bit program will silently give you its namesake in SysWOW64. |
|
From: Fabrizio B. <ext...@gm...> - 2015-02-18 11:46:35
|
Hello, I've tried it all but no luck... looks like MinGW 64 is not so good... thanks for helping anyway. I will try using Microsoft compiler to see if it's truly a compiler problem. 2015-02-12 18:06 GMT+01:00 Eli Zaretskii <el...@gn...>: > > Date: Thu, 12 Feb 2015 17:36:35 +0100 > > From: Gisle Vanem <gv...@ya...> > > > > Eli Zaretskii wrote: > > > > > Also note the SysWOW64 vs System32 gotcha: if you look at System32 > > > directory with 32-bit tools, Windows might fool you by redirecting to > > > SysWOW64 instead. > > > > For 32-bit programs, the pseudo-directory '%WinDir%\sysnative' dir > > (on Win-7/8) seems to contain all (?) files. All the .sys-files can > > be read with tools we're used to from Win-XP. You cannot do that for > > files under c:\Windows\SysWOW64. E.g.: > > pedump2 c:\Windows\Sysnative\drivers\npf.sys works fine. > > > > (NPF.sys is the driver for WinPcap) > > First, I meant *.dll files, not *.sys (I don't know what Windows does > about the latter). > > And second, what I meant is that trying to open or even list > %WinDir%\System32\foo.dll with a 32-bit program will silently give you > its namesake in SysWOW64. > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list > etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe > -- Fab http://twitter.com/fabrizioburatta http://www.linkedin.com/in/fburatta |