无法打开库蟒蛇.熊猫计划3D.与

Unable to open lib python. Project Panda3D. VS

本文关键字:熊猫 计划 3D      更新时间:2023-10-16

我刚刚用Panda3D开始了一个c++项目。( Visual Studio 2010 )

通过一个简单的HelloWorld,我添加了路径等。 没有编译错误,除了:

刚刚出现一个错误:

 error LNK1104: cannot open file 'python27_d.lib' 

而且我不知道如何解决它。

请帮忙 !

谢谢!

你可以做一些事情。

1)只是在发布模式下构建(不是一个好的解决方案,因为你不能用这种方式调试得太好)

2) 添加另一个基于"发布"的构建配置,但带有调试符号并且没有_DEBUG预处理器定义(可能会弄乱一些库)

3) 查找或构建一个 Python 2.7 版本,其中包含在 Visual Studio 2010 中构建的调试和发布库

4) 只需更改pyconfig.h中实际链接到 *.lib 文件的这一部分,即可将python27.lib用于两种配置。

/* For an MSVC DLL, we can nominate the .lib files used by extensions */
#ifdef MS_COREDLL
#   ifndef Py_BUILD_CORE /* not building the core - must be an ext */
#       if defined(_MSC_VER)
            /* So MSVC users need not specify the .lib file in
            their Makefile (other compilers are generally
            taken care of by distutils.) */
#           ifdef _DEBUG
#       //-----------------------change the next line-------------//
#               pragma comment(lib,"python27_d.lib") 
#           else
#               pragma comment(lib,"python27.lib")
#           endif /* _DEBUG */
#       endif /* _MSC_VER */
#   endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */

1)2)和4)是黑客解决方案,所以我建议你尝试使用3)。