473,772 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static python compile on windows.


Cheers.
First what I am trying to do:
I am trying to create a version of pytho23.dll that contains everything
inside of it. It is staticaly linked. It also needs to contain the qt
library. For this I am trying to work off of instructions designed for
unix/linux using visual c++.net and gui.

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 '

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. The only thing that gets build before pythoncore is the
make_versioninf o. 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.

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.

Tired, exhausted and frustrated.
Greg

"When ideas fail, words come in very handy."
- Goethe (1749-1832)
Jul 18 '05 #1
3 2887
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_versioninf o. 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
Jul 18 '05 #2
"Martin v. Löwis" <ma****@v.loewi s.de> writes:
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.


Please let me join this thread with a related question.
I've added a project to the MSVC6 workspace for Python 2.3, which
basically does this. It seems required to define the
Py_NO_ENABLE_SH ARED preprocessor flag when compiling this.

Now I have a ~900 kB static python.exe. How can I prevent that this exe
tries to import extension modules from the file system - it always
crashes with a Fatal Python error: Interpreter not initialized (because
it tries to load the normal python23.dll which I have also installed)?

Thomas
Jul 18 '05 #3
Thomas Heller wrote:
Now I have a ~900 kB static python.exe. How can I prevent that this exe
tries to import extension modules from the file system - it always
crashes with a Fatal Python error: Interpreter not initialized (because
it tries to load the normal python23.dll which I have also installed)?


See my comments to python-dev. The easiest way, as you explain, is to
disable dynamic loading in the first place. Alternatively, make sure
that the PE module it tries to load is the same as the one implementing
dynamic loading.

Regards,
Martin
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5695
by: Christos TZOTZIOY Georgiou | last post by:
Last night I was compiling the latest python snapshot at my home Linux system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried building a shared version of the interpreter. I did some speed comparisons, and pystone reported ~6090 pystones for the shared and ~7680 pystones for the (default) static build. This is quite a difference, and while I do know what impact position independent code has on libraries, this was the...
6
22721
by: Alexandre Gillet | last post by:
Hi, I am trying to build a python interpreter that is static link. My python interpreter was build on RedHat 8.0 using gcc 2.3 and GLIBC 2.3 When running on other linux flavor that still have GLIBC 2.2, the interpreter won't start. (error message: /lib/libc.so.6: version `GLIBC_2.3' not found (required by /mgl/python/i86Linux2/bin/python2.3) Is there a way to build a static python interpreter using gcc 2.3 that can run on any machine...
15
2676
by: Premshree Pillai | last post by:
How do I force static typing in Python? -Premshree Pillai ===== -Premshree http://www.qiksearch.com/] ________________________________________________________________________ Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more.
4
8031
by: Neil Zanella | last post by:
Hello, I would like to know whether it is possible to define static class methods and data members in Python (similar to the way it can be done in C++ or Java). These do not seem to be mentioned in "Learning Python" by Mark Lutz and David Ascher. It seems like they are a relatively new feature... It seems to me that any truly OO programming language should support these so I'm sure that Python is no exception, but how can these be...
4
4727
by: Torsten Mohr | last post by:
Hi, i'd like to build an executable file that is linked with a python library and executes a script via PyRun_SimpleString or similar functions. Is there a static library of python available, so the users don't need to install python?
3
2431
by: Olivier Ravard | last post by:
Hi, When I tryed to compile a python module using distutils under windows, and there is an error message if we do not have Microsoft Visual C++ 6 installed. This is because python have been compiled with MSVC6 and distutils wants it in order to compile C++ python modules. One of the reasons why I use python is because this is a free language. But I need
6
2235
by: JW | last post by:
I have a lousy little Python extension, generated with the generous help of Pyrex. In Linux, things are simple. I compile the extension, link it against some C stuff, and *poof*! everything works. My employer wants me to create a Windows version of my extension that works with the vanilla Python 2.5 from python.org. My employment contract states that I won't be required to run Windows, and I desperately want to honor that clause....
7
409
by: Anton Mellit | last post by:
Hi, I am working on a Pari-Python module (see about GP/PARI at http://pari.math.u-bordeaux.fr/). Similar project was started by Stefane Fermigier 12 years ago (you can find a post about it on this newsgroup). You can see some screenshots on my blog (http:// mellit.wordpress.com/2007/10/28/pari-python/). I reproduce the text on my blog here. I finished some working version of the pari-python module. I tried to
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.