.cpp到.pyd [英] .cpp to .pyd
问题描述
您好,
我想将我的C ++(。cpp)脚本构建为(.pyd),如下所示:
http://en.wikibooks.org/wiki/Python_...g_with_C%2B% 2B
我安装了Microsoft Visual Studio .NET 2003。和Boost
Python然后在我运行我的安装脚本后:
python setup.py build
我收到此错误:
运行build
运行build_ext
构建''你好''扩展名
D:\Program Files \ Microsoft Visual Studio .NET 2003 \ Vc7 \\ \\ bin\cl.exe / c /
nologo / Ox
/ MD / W3 / GX / DNDEBUG -IC:\ Panda3D-1.5.2\python \include -IC:
\ Panda3D-1.5.2 \ pytho
n\PC /Tphellomodule.cpp /Fobuild\temp.win32-2.5 \发布
\hellomodule.obj
hellomodule.cpp
hellomodule.cpp(9):致命错误C1083:无法打开包含文件:
''boost / python /
module.hpp'':没有这样的文件或目录
错误:命令''" D:\\ \\ Program Files \ Microsoft Visual Studio .NET
2003 \Vc7 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ >
我认为我的MS vi sual工作室找不到boost python,如果
那就是问题,那么你能告诉我怎样才能解决它。
这是一个非常简单的问题,但是我无法找到答案,而且我不会对微软的产品有所了解。
抱歉我的英文不好!
问候,
Veki
Hello,
I want to build my C++ (.cpp) script to (.pyd) like this:
http://en.wikibooks.org/wiki/Python_...g_with_C%2B%2B
I have installed "Microsoft Visual studio .NET 2003" and "Boost
Python" and then after I run my setup script:
python setup.py build
I get this error:
running build
running build_ext
building ''hello'' extension
D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe /c /
nologo /Ox
/MD /W3 /GX /DNDEBUG -IC:\Panda3D-1.5.2\python\include -IC:
\Panda3D-1.5.2\pytho
n\PC /Tphellomodule.cpp /Fobuild\temp.win32-2.5\Release
\hellomodule.obj
hellomodule.cpp
hellomodule.cpp(9) : fatal error C1083: Cannot open include file:
''boost/python/
module.hpp'': No such file or directory
error: command ''"D:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\cl.e
xe"'' failed with exit status 2
I think that my MS visual studio cannot find "boost python", if
that''s the problem then can you tell me how can I solve it.
This is very begginer question,but I can''t find answer nowhere, and I
don''t have any expirience with Microsoft products.
Sorry for my bad english!
Regards,
Veki
推荐答案
我认为我的MS visual studio找不到boost python,如果
I think that my MS visual studio cannot find "boost python", if
这就是问题那么你能告诉我怎样才能解决它。
这是一个非常简单的问题,但我无法找到答案,而且我不会对微软的产品有所了解。
that''s the problem then can you tell me how can I solve it.
This is very begginer question,but I can''t find answer nowhere, and I
don''t have any expirience with Microsoft products.
将Boost放入包含路径(Visual Studio的选项)。
>
Matthieu
-
法国博士生
网址: http://matthieu-brucher.developpez.com/
博客: http://matt.eifelle.com 和 http://blog.developpez.com/?blog=92
LinkedIn: http://www.linkedin.com/in/matthieubrucher
Hi,
Put Boost in your include path (options of Visual Studio).
Matthieu
--
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
7 kol,09:48,Matthieu Brucher < matthieu.bruc ... @ gmail.com>
写道:
On 7 kol, 09:48, "Matthieu Brucher" <matthieu.bruc...@gmail.com>
wrote:
我认为我的MS visual studio *找不到boost python,如果
那么'问题那么你能告诉我怎样才能解决它。
这是非常的乞丐问题,但我无法找到答案,而且我不会对微软的产品有任何看法。
I think that my MS visual studio *cannot find "boost python", if
that''s the problem then can you tell me how can I solve it.
This is very begginer question,but I can''t find answer nowhere, and I
don''t have any expirience with Microsoft products.
将Boost放入包含路径(Visual Studio的选项)。
>
Matthieu
-
法国博士生
网址: http://matthieu-brucher.developpez.com/
博客: http://matt.eifelle.comandhttp://blo...z.com /?blog = 92
LinkedIn: http ://www.linkedin.com/in/matthieubrucher
再次问好,
感谢您的快速回复!
Hello again,
Thanks for your quick reply!
将Boost放入包含路径(Visual Studio的选项)中。
Put Boost in your include path (options of Visual Studio).
看看我的形象:
http://img225.imageshack.us/my.php?i...imghostfy1.png
我还是得到同样的错误。
问候,
Veki
Look at my image:
http://img225.imageshack.us/my.php?i...imghostfy1.png
I still get the same error.
Regards,
Veki
ve *********** @ yahoo.com 写道:
hellomodule.cpp(9):致命错误C1083:无法打开包含文件:
''boost / python / module.hpp'':没有这样的文件或目录
hellomodule.cpp(9) : fatal error C1083: Cannot open include file:
''boost/python/module.hpp'': No such file or directory
你需要告诉它在哪里找到Boost包含。我建议你先用
尝试以一些只有标题的Boost库为例,如果你有正确的
,你也可以使用包含路径。
在您的第二个帖子中,您给出了一张图片的链接,该图片具有确切的
右对话框,用于将其设置为系统设置。您还可以在每个项目基础上设置
a的路径,然后它在C ++设置中。
请注意,对于像Boost这样的已编译库。 Python你首先必须编译那些(参见Boost文档),把DLL放到一个可以找到它的地方(例如windows dir或其他任何东西)路径)并且还必须在链接器设置中设置.LIBS的路径。
作为单独编译库的替代方法,您还可以包含
将Boost源添加到您的项目中,只需将BOOST_PYTHON_STATIC_LIB添加到
预处理器定义并包含以下文件(!)
翻译单位:
< boost /../ libs / python / src / module.cpp>
< boost /../ libs / python / src / dict.cpp>
< boost /../ libs / python / src / errors.cpp>
< boost /../ libs / python / src / list.cpp>
< boost /../ libs / python / src / object_operators.cpp>
< boost /../ libs / python / src / object_protocol.cpp>
< boost /../ libs / python / src / tuple.cpp>
< boost /../ libs / python / src / str.cpp>
< boost /../ libs / python / src / object / class.cpp>
< boost /../ libs / python / src / object / function.cpp>
< boost /../ libs / python / src / object / inheritance.cpp> ;
< boost /../ libs / python / src / object / pickle_support.cpp>
< boost /../ libs / python / src / converter /builtin_converters.cpp>
< boost /../ libs / python / src / converter / registry.cpp>
< boost /../ libs / python /src/converter/from_python.cpp>
注意:这是Boost 1.33.1,新版本可能不同。
Uli
< br $>
-
Sator Laser GmbH
Gesch?¤ftsf?? hrer:Thorsten F ?? cking,Amtsgericht Hamburg HR B62 932 >
这篇关于.cpp到.pyd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!