如何创建空的工作boost::python::dict
How to create empty working boost::python::dict?
我解析了一个C++项目,该项目编译为python的library.so
。所以我无法在Qt创建者IDE中调试它。为此,我使用可执行文件main()创建了单独的项目:
int main()
{
boost::python::dict whiteList;
whiteList.has_key("blablabla");
...
return 0;
}
在发布模式下,程序编译和工作不正确。但在调试模式下程序在has_key()
方法中失败,并出现错误窗口:
The inferior stopped because it received a signal from the Operating System.
Signal name : SIGSEGV
Signal meaning : Segmentation fault
问题可能是:如何在不涉及python脚本的情况下,在C++
程序中正确创建和使用boost::python::dict
?
无论何时使用Python C API或Boost Python,都必须初始化Python:
Py_Initialize();
将其添加到您的main()
et voila的顶部。
相关文章:
- boost信号和插槽在不同的线程中不工作(使用boost::asio::io_service)
- 多个共享工作池,带 Boost::Fiber
- Boost Log的琐碎记录器"lazy evaluation"是如何工作的?
- boost::make_shared 失败,但 std::make_shared 工作
- 来自 boost 的 udp 服务器不适用于多线程,但仅在主线程上工作
- boost::asio 使用 post() 时没有调用处理程序,当直接调用函数时有效(io_context有工作)
- thread_specific_pointer可以在哪些平台上工作而无需 boost::thread?
- 如果我将作品张贴到线程池,并且线程已经在Boost中工作,会发生什么
- 防止Boost :: Asio :: IO_Context在没有更多工作时返回
- Boost::线程如何在主线程和工作线程之间同步
- 尝试在Visual Studio工作时使用CLION的Boost 1.69.0,但给出了奇怪的MINGW错误
- 很难从c++boost库中获得barycentric_riomic来按照我的需要工作
- boost::asio绞线缠绕的线程无法立即工作
- 无法让 matplotlib 事件处理程序与 Boost.Python 一起工作
- Boost::Windows上的Asio无法异步工作
- boost binary_oarchive 对于不同的编译器,其工作方式不同
- 使用 Boost 'ptree.find' 无法按预期工作
- 将 Boost.Serialization 直接与虚拟钻石继承一起工作
- Boost::P rocess编译问题,不得不修改库才能使其工作
- c++:让Boost工作;关于包含路径和链接库的问题