I have a Python script for python 2.7, say this:
print("Hello World!")
Next I turn this into C using:
python cython.py --embed helloworld.py
And then I try to compile it statically:
gcc -IC:\Python27\include -LC:\Python27\libs helloworld.c -Wl,-Bstatic -lpython27
-Wl,-Bdynamic
But gcc just creates a binary that uses the python27.dll runtime. How can I create a binary that statically links to the runtime?
If you are working from Linux or OS X, you can use my engine's builder tool, Schafer, which has a "bare" mode which will just build Python statically (for all supported platforms, including Windows), along with several standard modules, and it will also "cythonize" and embed your sources into it as well. If this doesn't fit your bill, you still can get ideas from the source on what it takes to do what you want to accomplish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With