Link to Python with MinGW

前端 未结 3 1489
谎友^
谎友^ 2020-12-01 13:22

I wan\'t want to create a cross-plattform programm that embedds the python interpreter, and compile it with MinGW. But the Python Binary distribution provides no libraries f

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 13:52

    Try this...

    1. Download gendef for your version of mingw (32 or 64 bit), and in msys shell...
    2. Run gendef /c/windows/system32/python32.dll
    3. Run dlltool -D python32.dll -d python32.def -l libpython32.a
    4. Copy libpython32.a to your ./python32/libs directory.

    If your libpython32.a file is 0 bytes, something went wrong. Double-check that you downloaded the correct version of gendef for your version of mingw/msys. If you're running a 64-bit build, you'll likely have to download the gendef binaries and compile yourself, but that's simple enough.

    Hope that helps.

提交回复
热议问题