gpt4 book ai didi

python - Boost Python,Visual Studio 不创建 DLL

转载 作者:行者123 更新时间:2023-11-30 05:33:03 26 4
gpt4 key购买 nike

所以我最终成功地在 Visual Studio 中构建了我的 boost::python 项目,没有任何错误,只是发现 Visual Studio 没有为我创建 DLL。我使用在大多数教程中都可以找到的这个例子(以某种形式):

#include <boost/python/module.hpp>
#include <boost/python/def.hpp>


char const* greet()
{
return "hello, world";
}

BOOST_PYTHON_MODULE(myFirstModule)
{
using namespace boost::python;
def("greet", greet);
}

Visual Studio 的输出如下:

1>  Finished generating code
1> test.vcxproj -> P:\blub\x64\Release\test.dll
1> test.vcxproj -> P:\blub\x64\Release\test.pdb (Full PDB)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

所以它看起来不错,但是提到的文件夹中没有 DLL。

最佳答案

查看您提供的 Visual Studio Output Window 日志,似乎 Visual Studio 完成了它的部分工作(至少说它完成了)。

我猜,从路径 P:\blub\x64\Release\test.dll 以驱动器号 P:\ 开始,目标文件夹位于网络共享。

您可能没有权限:

  • 修改此文件夹
  • 编写 test.dll
  • 或两者兼而有之

尝试在项目设置中将目标路径修改为您确定可以写入的文件夹,看看是否能解决您的问题。

如果您必须使用网络共享,read this

关于python - Boost Python,Visual Studio 不创建 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34929896/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com