Using Python 3.3 in C++ 'python33_d.lib' not found

前端 未结 5 2111
情歌与酒
情歌与酒 2020-12-13 10:54

I am trying to #include in my C++ code and when I go to compile my code I get the error of:

fatal error LNK1104: cannot open fi         


        
5条回答
  •  孤街浪徒
    2020-12-13 11:24

    In the event that you need a debug version (as I do for work), it is possible to build the library yourself:

    1. Download the source tarball from http://www.python.org/download
    2. Extract the tarball (7zip will do the trick) and go into the resulting directory (should be something like Python-3.3.2).
    3. From the Python directory, go to the PCBuild folder. There are two important files here: readme.txt, which contains the instructions for building Python in Windows (even if it uses the UNIX line feed style...), and pcbuild.sln, which is the Visual Studio solution that builds Python.
    4. Open pcbuild.sln in Visual Studio. (I am assuming you are using Visual Studio 10; readme.txt contains specific instructions for older versions of Visual Studio.)
    5. Make sure Visual Studio is set to the "debug" configuration, and then build the solution for your appropriate architecture (x64 or Win32). You may get a few failed subprojects, but not all of them are necessary to build python33_d; by my count, 8 builds failed and I got a working .lib file anyway.
    6. You will find python33_d.lib and python33_d.dll in either the PCBuild folder (if building Win32) or the amd64 subfolder (if building x64).

提交回复
热议问题