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

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

问题描述

我正在尝试在安装了VisualStudio 2015的Windows计算机上编译pybind11.我还安装了python 3.5.3 64bit和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天全站免登陆