Static python compile on windows.

"Martin v. Löwis" martin at v.loewis.de
Wed Jul 28 03:06:20 EDT 2004


Grzegorz Dostatni wrote:
> I can compile basic python - that's not a problem. Once I add the paths
> and dependencies for qt (as well as modifying the config.c) I get an
> error:
> 
> LINK : fatal error LNK1181: cannot open input file '.\python23.lib'

I don't understand. If you want to make Python and all of the modules
static (i.e. a single executable), then you should build qt *inside*
pcbuild. Then, there is no need to link qt with python23.lib at all.

> Problem is I don't know where/when this gets created. python23.dll is
> created as a result of pythoncore project. The python23.dll depends on
> python23.lib. 

That is not true, atleast not in the distribtion of Python shipped from
python.org. In what way have you modified the existing projects?

The python23.dll is completely independent from python23.lib: you don't
need python23.lib to run Python. The project generating python23.lib
is the same as the one generating python23.dll, namely pythoncore.

 > The only thing that gets build before pythoncore is the
> make_versioninfo. I dug through the logs and was unable to determine where
> python23.lib gets created. And how. If I can see why it is not created I
> should be able to fix the problem.

It is generated as a a result (as a side effect) of linking
python23.dll. It is called an "import library".

> Alternatively, did anyone figure out how to statically compile qt into
> python? I can do the dynamic compile, but I need static for program
> deployment.

You should build as many static libraries as you need, e.g.
python23s.lib, qtXYs.lib, and so on. Static libraries don't depend
on each other, so you can build them independent from one another.
You should then link them all together, either linking them into
python.exe or pythonw.exe.

Regards,
Martin



More information about the Python-list mailing list