简体   繁体   中英

CMake find_package(PythonLibs) not working

I am trying to use Python.h in a C++ project compiled with g++. I am using CMake to generate proper include/lib links. I am using the built-in feature

find_package(PythonLibs REQUIRED)

but cannot get it working. I have been looking in FindPythonLibs.cmake to see what CMake was looking for and I found some registry keys that were missing on my machine. For example in the PYTHON_INCLUDE_DIR section : [HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]/include

Here is what I found in my registry :

  • HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python.CompiledFile
  • HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python.File
  • HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python.NoConFile

I have my Python files installed in C:/Python33 and find_package(PythonInterp) is working fine (maybe because it finds the .exe file without having to hit the registry). Seems like some things are missing... Is there a quick way to fix this ?

[Setup] : Python 3.3.2, Win8 64bit

我有一个32位的MinGW和一个64位的Python发行版...我安装了32位的Python发行版,现在find_package(PythonLibs)正在运行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM