我将 Microsoft Visual Studios 2012 中的 Boost 库用于将嵌入 Python 的 C++ 程序。问题是当我尝试构建解决方案 [F7] 时;我明白了::
Error 1 error LNK1104: cannot open file 'python33.lib' C:\Users\usr\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\LINK
问题是,我不知道这是什么,意味着什么,也不知道如何解决它。我已经尝试将我的 python 文件夹移动到我的桌面中,因为它最初位于 C:\ 中,我认为这可能是权限错误,但这并没有做任何事情。
这是我为准备项目而阅读的教程中的代码::
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <boost/lambda/lambda.hpp>
#include <boost/python.hpp>
using namespace boost::python;
int main( int argc, char ** argv ) {
try {
Py_Initialize();
object main_module((
handle<>(borrowed(PyImport_AddModule("__main__")))));
object main_namespace = main_module.attr("__dict__");
handle<> ignored(( PyRun_String( "print \"Hello, World\"",
Py_file_input,
main_namespace.ptr(),
main_namespace.ptr() ) ));
} catch( error_already_set ) {
PyErr_Print();
}
}
--Visual Studios 2012 --Windows 7 x64 --Python 3.3.2 --Boost 库 --Python Embedded C++ 程序
--链接到教程页面: http: //wiki.python.org/moin/boost.python/EmbeddingPython