Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.4 & undefined reference to `_PyGen_Send' #1968

Closed
KeyWeeUsr opened this issue Oct 30, 2017 · 2 comments
Closed

Python 3.4 & undefined reference to `_PyGen_Send' #1968

KeyWeeUsr opened this issue Oct 30, 2017 · 2 comments

Comments

@KeyWeeUsr
Copy link

KeyWeeUsr commented Oct 30, 2017

  • GCC from mingwpy-0.1.0b3
  • Python 3.4.4
  • Cython 0.27.2

I think it was introduced in 0.27, our build reports the issue for Python 3.4 versions. See this commit - 72acc2c and

// _PyGen_Send() is not exported before Py3.6

Also notice 3.3+ referenced here and not in the rest of the lines:

#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (!defined(_MSC_VER) || PY_VERSION_HEX >= 0x03060000)

build

writing build\temp.win32-3.4\Release\kivy\_event.def
C:\Python34\Scripts\gcc.exe -shared -s build\temp.win32-3.4\Release\kivy\_event.o build\temp.win32-3.4\Release\kivy\_event.def -LC:\Python34\libs -LC:\Python34\libs -LC:\Python34\PCbuild -lpython34 -lmsvcr100 -o C:\projects\kivy\kivy\_event.pyd -lm
build
\temp.win32-3.4\Release\kivy\_event.o:_event.c:(.text+0x45da): undefined reference to `_PyGen_Send'
build\temp.win32-3.4\Release\kivy\_event.o:_event.c:(.text+0x9290): undefined reference to `_PyGen_Send
'
collect2.exe: error: ld returned 1 exit status
 error: command 'C:\\Python34\\Scripts\\gcc.exe' failed with exit status 1
Failed with exit code 1

The file _event.pxd hasn't changed for quite a while + the build worked fine with <0.27.

Any ideas how to fix it without downgrading to 0.26?

@scoder scoder added this to the 0.27.3 milestone Oct 31, 2017
@scoder
Copy link
Contributor

scoder commented Oct 31, 2017

MinGW probably doesn't set _MSC_VER (because, why should it?), so the guard doesn't apply and opens up the special case for Python < 3.6. Problem is, it shouldn't guard against MSVC since this is a platform issue, not a compiler thing. The _PyGen_Send() function is not properly exported before python/cpython@833c626, and the fact that Linux systems do not care is not a good excuse for blaming it on Windows (let alone MSVC, although that is always a good target for blaming). I'll change the guard to defined(__linux__) for 0.27.3.

@scoder scoder closed this as completed in cd3e189 Oct 31, 2017
@KeyWeeUsr
Copy link
Author

@scoder Thanks for such a quick response and for the fix! :) Any ETA for 0.27.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants