1
votes

My environment: Windows 7 64 pro, mingw32 (installed with 2012-04-26.exe installer), msys 1.0, Python 2.7.3 installed using the Win64 installer from python.org

I'm trying to compile a c++ program that has python bindings, using mingw and msys. When I run config from the msys shell, I get the errors

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.
============================================================================

I've tried to run configure with each of:

./configure LDFLAGS="-L/c/Python27/libs"

./configure LDFLAGS="-L/c/Python27/Lib"

./configure LDFLAGS="-Lc:/Python27/libs"

./configure LDFLAGS="-Lc:/Python27/libs"

and all give me the same final error. I've posted the entire config.log file at http://pastebin.com/fZVjTeub. Any help?

2
Is your python path valid? it looks a little odd c/Python27/Lib should it not be c:/Python27/Lib or do you have a symbolic link pointing c to your c: drive?EdChum
Thanks @EdChum, I tried the different variations and none seem to help. The msys shell has /c symlinked (is that the right term?) to c:/user327301
See from the terminal where it thinks your python is located, and use that path, remember that it will be case sensitive so try to cd to different folders until you locate where the python folder is.EdChum
which python returns /c/Python27/./python.exeuser327301
where are the python libs located? could you try setting a symbolic link to the libs folder and passing this to ./configure?EdChum

2 Answers

1
votes

The problem was ultimately that I was using a 32-bit compiler and trying to link it to 64-bit Python.

0
votes

In my case I've had to pass LDFLAGS="-L/c/Python27/libs" to ./configure