mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Crosscompiling and linking against Win32 Pyth


From: Stefan Löffler
Subject: Re: [Mingw-cross-env-list] Crosscompiling and linking against Win32 Python, possible?
Date: Thu, 24 Mar 2011 19:05:55 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

Hi,

I have no experience with writing a Python compiler, but I did include
the Python interpreter in TeXworks when building it with mingw-cross-env.

On 2011-03-24 10:40, Kay Hayen wrote:
> Now with Python, I decided I would download and install the
> ActiveState build with wine and access the Python include files and
> Libraries from there.

That's what I did, too.

> Then I integrated that into scons, and it finally comes up with a
> command like this:
>
> # /opt/mingw/usr/bin/i686-pc-mingw32-g++ -o pystone.exe
> -Wl,--enable-auto-import pystone.build/static/CompiledFunctionType.o
> pystone.build/static/CompiledGeneratorType.o
> pystone.build/static/CompiledMethodType.o
> pystone.build/static/CompiledGenexprType.o
> pystone.build/static/CompiledCodeHelpers.o
> pystone.build/static/win32_ucontext_src/ucontext.o
> pystone.build/__constants.o pystone.build/__main__.o
> -L/home/hayen/.wine/drive_c/Python26/libs
> -L/home/hayen/.wine/drive_c/windows/system32 -lpython26
> /home/hayen/.wine/drive_c/windows/system32/user32.dll: file not
> recognized: File format not recognized

All I can say is that I didn't have to add the windows/system32 path. I
basically just had to add
-L../../../../pkg/python-win32/libs/ -lpython27

In fact, I'd rather avoid pulling in anything from Wine, as I'm not sure
how well this works on a "real" Windows.

With the line above, I just have to distribute the python27.dll and
(some) precompiled Python scripts (.pyc) in the Lib folder along with
the main application. (To get the .pyc files, I just ran `wine python`
once).

BTW: AFAIK, mingw-cross-env statically links user32, at least there is a
libuser32.a in usr/i686-pc-mingw32/lib.

HTH
Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]