I am trying to embed Python in C on Visual Studio, but I cannot open ' python36_d.lib'
error occurs during build.
I tried to set it to the Release build by referring to the page below, but it didn't been fixed.
Why?
Using Python 3.3 in C++'python33_d.lib'not found-Stack Overflow
Environment Windows 10 home, Visual Studio 2017 Community, Python 3.6
configuring:Release
Platform: x64
Project Properties
Additional Dependencies
python36.lib
% (AdditionalDependencies)
Include Directory
C:\Program Files\Python36\include;$(IncludePath)
Additional Library Directory
C:\Program Files\Python36\libs;% (AdditionalLibraryDirectories)
Attempted to set it to Release Build
Where did you set it to Release?
Visual Studio has a solution that binds individual projects together.You can find them in the Configuration Manager located in the build menu.
You select Release
in the active solution configuration at the top of Configuration Manager, but the solution is only configured at this stage.In the list at the bottom of the Configuration Manager, you must also select the project configuration that corresponds to the active solution configuration.
In other words, if the solution configuration is set to Release
, but the corresponding project configuration is Debug
, it will eventually be built with Debug
.
Additional Dependencies
python36.lib
% (AdditionalDependencies)
pyconfig.h contains
#if defined(_DEBUG)
# pragma comment (lib, "python36_d.lib")
# elif defined (Py_LIMITED_API)
# pragma comment (lib, "python3.lib")
# else
# pragma comment (lib, "python36.lib")
# endif /*_DEBUG*/
You do not need to configure additional dependency files because they are listed as .
Also, as you can see from this code, even if you set the project configuration to Release
, if you have defined the preprocessor macro _DEBUG
, python36_d.lib
is still required.
© 2024 OneMinuteCode. All rights reserved.