python37.dll not linked in executable

前端 未结 2 1939
时光取名叫无心
时光取名叫无心 2020-12-22 12:15

I extended c++ with python but the exectuable won\'t run on systems that do not have python installed.

#include \"C:\\.....python.h\"

int main()
{
    Py_In         


        
相关标签:
2条回答
  • 2020-12-22 12:21

    A DLL is by definition a dynamically linked library, it is a separate module that is looked up and resolved at run time.

    If Python is not installed, your application won't run.

    You need to either bundle Python with your application or install Python before/during your application installation.

    Alternatively you can try linking with Python statically, in which case it will become part of the executable and won't need to be installed separately.

    0 讨论(0)
  • 2020-12-22 12:30

    Make sure your python folder is in your PATH so it can find the DLL in question.

    From the command line:

    c:\> set PATH=c:\python\python37;%PATH%
    c:\> cd /d c:\path\to\your\exe
    c:\path\to\you\exe> myprogram.exe
    

    For more details about how DLLs are found and loaded read the Dynamic-Link Library Search Order page on MSDN

    0 讨论(0)
提交回复
热议问题