[pypy-issue] [issue1635] numpy: compilation failed, unresolved external (msvc)

mattip tracker at bugs.pypy.org
Sat Nov 16 21:11:58 CET 2013


mattip <matti.picus at gmail.com> added the comment:

link is missing python27.lib, which is located in <pypy_base>\include. This is 
an import lib (telling the linker that the functions in it are located in 
libpypy-c.dll), used in MSVC instead of linking directly to a *.dll or *.so like 
gcc does.

CPython solves this with a trick - in <cpython_base>\include\pyconfig.h there is 
a pragma that magically adds the import lib to anything that #includes 
pyconfig.h I tried doing this in our pyconfig.h which seems to fix the problem 
for me.

Could you try replacing pypy's pyconfig.h with the one attached and update the 
issue accordingly?

----------
nosy: +mattip
release:  -> ???
status: unread -> in-progress

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1635>
________________________________________
-------------- next part --------------
#ifndef Py_PYCONFIG_H
#define Py_PYCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif

#define HAVE_PROTOTYPES 1
#define STDC_HEADERS 1

#define HAVE_LONG_LONG 1
#define HAVE_STDARG_PROTOTYPES 1
#define PY_FORMAT_LONG_LONG "ll"
#define PY_FORMAT_SIZE_T "z"
#define WITH_DOC_STRINGS
#define HAVE_UNICODE
#define WITHOUT_COMPLEX
#define HAVE_WCHAR_H 1

/* PyPy supposes Py_UNICODE == wchar_t */
#define HAVE_USABLE_WCHAR_T 1
#ifndef _WIN32
#define Py_UNICODE_SIZE 4
#define Py_UNICODE_WIDE
#else
#define Py_UNICODE_SIZE 2
#       if defined(_MSC_VER)
            /* So MSVC users need not specify the .lib file in
             *          their Makefile (other compilers are generally
             *                      taken care of by distutils.) */
#           ifdef _DEBUG
#               pragma comment(lib,"python27_d.lib")
#           else
#               pragma comment(lib,"python27.lib")
#           endif /* _DEBUG */
#       endif /* _MSC_VER */

#endif

#ifdef __cplusplus
}
#endif
#endif


More information about the pypy-issue mailing list