1

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?

7
  • 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? Commented May 26, 2012 at 17:42
  • 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:/ Commented May 26, 2012 at 18:13
  • 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. Commented May 26, 2012 at 20:33
  • which python returns /c/Python27/./python.exe Commented May 26, 2012 at 20:43
  • where are the python libs located? could you try setting a symbolic link to the libs folder and passing this to ./configure? Commented May 26, 2012 at 22:45

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

3 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
@Victor Why doesn't it provide an answer? This is how he solved the problem.
An answer shouldn't begin with in my case. You should provide a solution with some documentation to support it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.