C++ 来自'的转换错误;未签名的uu int64';至';未签名的uu int64*';-Pybind11

C++ 来自'的转换错误;未签名的uu int64';至';未签名的uu int64*';-Pybind11,c++,c++11,type-conversion,pybind11,C++,C++11,Type Conversion,Pybind11,下载完这个 并创建一个简单的cpp文件: #include <pybind11/pybind11.h> int add(int i, int j) { return i + j; } PYBIND11_MODULE(example, m) { m.doc() = "pybind11 example plugin"; // optional module docstring m.def("add", &add, "A function which adds

下载完这个 并创建一个简单的cpp文件:

#include <pybind11/pybind11.h>

int add(int i, int j) { return i + j; }

PYBIND11_MODULE(example, m) {
    m.doc() = "pybind11 example plugin"; // optional module docstring
    m.def("add", &add, "A function which adds two numbers");
}
#包括
intadd(inti,intj){返回i+j;}
PYBIND11_模块(示例,m){
m、 doc()=“pybind11示例插件”;//可选模块docstring
m、 def(“add”、&add,“一个添加两个数字的函数”);
}

我得到这个错误


错误C2446'这似乎是与

  std::vector<bool>
std::vector
这里提出的另一个问题是:

切换到下方窗格中的“构建”视图,并将文本粘贴到此处。那里会有更多的信息。此错误源于矢量实现,但不是发生此错误的地方。此外,请尝试生成一个(注意此处的“Complete”)。@BJovke添加了完整输出,希望有帮助。是的,这有帮助,错误在“cast.h”中。我必须看一下。实际上错误在“pybind11.h”中,但您发布的错误日志中的行与您在问题中引用的ZIP文件中的行不匹配。所以代码可能不一样。能否重新下载ZIP文件,再次使用它构建并再次发布错误?
1>------ Rebuild All started: Project: Test_CreatePythonBindings, Configuration: Debug x64 ------
1>example.cpp
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2326): error C2446: '<': no conversion from 'unsigned __int64' to 'unsigned __int64 *'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2326): note: Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2325): note: while compiling class template member function 'std::_Vb_const_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>> &std::_Vb_const_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>>::operator +=(__int64)'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2545): note: see reference to function template instantiation 'std::_Vb_const_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>> &std::_Vb_const_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>>::operator +=(__int64)' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2490): note: see reference to class template instantiation 'std::_Vb_const_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>>' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(3094): note: see reference to class template instantiation 'std::_Vb_iterator<std::_Wrap_alloc<std::allocator<std::_Vbase>>>' being compiled
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(3093): note: while compiling class template member function 'void std::vector<bool,std::allocator<_Ty>>::push_back(const bool &)'
1>        with
1>        [
1>            _Ty=bool
1>        ]
1>c:\pybind11-2.2.3\include\pybind11\pybind11.h(513): note: see reference to function template instantiation 'void std::vector<bool,std::allocator<_Ty>>::push_back(const bool &)' being compiled
1>        with
1>        [
1>            _Ty=bool
1>        ]
1>c:\pybind11-2.2.3\include\pybind11\cast.h(1806): note: see reference to class template instantiation 'std::vector<bool,std::allocator<_Ty>>' being compiled
1>        with
1>        [
1>            _Ty=bool
1>        ]
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\vector(2326): warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence
1>Done building project "Test_CreatePythonBindings.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
  std::vector<bool>