【发布时间】:2012-05-26 17:23:06
【问题描述】:
我的环境:Windows 7 64 pro、mingw32(使用 2012-04-26.exe 安装程序安装)、msys 1.0、使用 python.org 的 Win64 安装程序安装的 Python 2.7.3
我正在尝试使用 mingw 和 msys 编译具有 python 绑定的 c++ 程序。当我从 msys shell 运行配置时,我得到了错误
Could not link test program to Python.
Maybe the main Python library has been installed in some non-standard library path.
If so, pass it to configure, via the LDFLAGS environment variable.
Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
============================================================================
ERROR!
You probably have to install the development version of the Python package
for your distribution. The exact name of this package varies among them.
============================================================================
我已尝试使用以下各项运行配置:
./configure LDFLAGS="-L/c/Python27/libs"
./configure LDFLAGS="-L/c/Python27/Lib"
./configure LDFLAGS="-Lc:/Python27/libs"
./configure LDFLAGS="-Lc:/Python27/libs"
并且都给了我同样的最终错误。我已将整个 config.log 文件发布在 http://pastebin.com/fZVjTeub。有什么帮助吗?
【问题讨论】:
-
你的python路径有效吗?
c/Python27/Lib看起来有点奇怪,不应该是c:/Python27/Lib还是你有一个符号链接将 c 指向你的 c: 驱动器? -
感谢@EdChum,我尝试了不同的变体,但似乎没有任何帮助。 msys shell 有 /c 符号链接(这是正确的术语吗?)到 c:/
-
从它认为你的 python 所在的终端查看,并使用该路径,记住它是区分大小写的,所以尝试
cd到不同的文件夹,直到你找到 python 文件夹的位置。 -
哪个python返回/c/Python27/./python.exe
-
python 库在哪里?您可以尝试设置指向 libs 文件夹的符号链接并将其传递给 ./configure 吗?