pybind11 “Python 是 64 位,选择的编译器是 32 位"; [英] pybind11 "Python is 64-bit, chosen compiler is 32-bit"

查看:49
本文介绍了pybind11 “Python 是 64 位,选择的编译器是 32 位";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在安装了 VisualStudio 2015 的 Windows 机器上编译 pybind11.我还安装了 python 3.5.3 64 位和 cmake 2.8.12.我收到错误:

I'm trying to compile pybind11 on a Windows machine that has VisualStudio 2015 installed. I also have python 3.5.3 64bit installed, and cmake 2.8.12. I get the error:

CMake Error at tools/FindPythonLibsNew.cmake:122 (message):
  Python config failure: Python is 64-bit, chosen compiler is 32-bit
Call Stack (most recent call first):
  tools/pybind11Tools.cmake:16 (find_package)
  CMakeLists.txt:28 (include)

我没有选择"编译器为 32 位,查看 CMakeLists.txt,我没有找到任何指定要运行哪个编译器的地方.那么如何告诉 pybind11/cmake 编译为 64 位呢?

I did not "choose" the compiler to be 32-bit, and looking at the CMakeLists.txt, I did not find any place to specify which compiler to run. So how to I tell pybind11/cmake to compile for 64 bit?

推荐答案

您应该像这样指定 64 位 VS 编译器:

You should specify the 64-bit VS compiler like so:

cmake "/path/to/src/" -G"Visual Studio 14 2015 Win64"

否则默认选择 32 位.

Otherwise it selects the 32-bit by default.

这篇关于pybind11 “Python 是 64 位,选择的编译器是 32 位";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆