{"action":"created","issue":{"url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/31","labels_url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/31/comments","events_url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/31/events","html_url":"https://github.com/mingwpy/mingwpy.github.io/issues/31","id":128177992,"number":31,"title":"Error trying to build Cython from source with mingwpy-0.1.0b3 in a virtualenv","user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":51,"created_at":"2016-01-22T15:24:47Z","updated_at":"2016-01-26T12:50:59Z","closed_at":null,"body":"```\r\ngit clone https://github.com/cython/cython\r\ncd cython\r\ngit checkout 0.23.4  # latest release\r\npython setup.py build --compiler=mingw32\r\n```\r\n\r\nI get the following errors (truncated):\r\n\r\n```\r\nC:\\msys64\\home\\ogrisel\\venv\\mingwpy\\Scripts\\gcc.exe -shared -s c:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o c:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\Scanners.def -Lc:\\python34\\Libs -LC:\\msys64\\home\\ogrisel\\venv\\mingwpy\\libs -LC:\\msys64\\home\\ogrisel\\venv\\mingwpy\\PCbuild\\amd64 -lpython34 -lmsvcr100 -o build\\lib.win-amd64-3.4\\Cython\\Plex\\Scanners.pyd\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x3): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x110): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x13e): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x16c): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x19a): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x1cb): more undefined references to `__imp__Py_NoneStruct' follow\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x7ca): undefined reference to `__imp_PyBaseObject_Type'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x7e7): undefined reference to `__imp__Py_NoneStruct'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x8ca): undefined reference to `__imp_PyExc_TypeError'\r\nc:\\msys64\\home\\ogrisel\\cython\\cython\\plex\\scanners.o:Scanners.c:(.text+0x907): undefined reference to `__imp_PyExc_TypeError'\r\n..\r\n```\r\n\r\nFull log at: https://gist.github.com/ogrisel/ba513e2aa19583202973\r\n\r\n- Python 3.4.4\r\n- Windows 10"},"comment":{"url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/comments/174998162","html_url":"https://github.com/mingwpy/mingwpy.github.io/issues/31#issuecomment-174998162","issue_url":"https://api.github.com/repos/mingwpy/mingwpy.github.io/issues/31","id":174998162,"user":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T12:50:59Z","updated_at":"2016-01-26T12:50:59Z","body":"Here is another minimalistic reproduction case:\r\n\r\nLinking against `python34.lib` shipped with Python amd64 from python.org fails:\r\n\r\n```\r\nPS C:\\src> C:\\venv\\py34/Scripts\\gcc.exe -shared test.c C:\\python34_x64\\libs\\python34.lib -Ic:\\python34_x64\\include -lmsvcr100 -o output_py34.pyd\r\nC:\\Users\\OLIVIE~1\\AppData\\Local\\Temp\\ccWxX8rX.o:test.c:(.text+0xb): undefined reference to `__imp__Py_NoneStruct'\r\ncollect2.exe: error: ld returned 1 exit status\r\n```\r\nwhile linking with `libpython34.dll.a` from mingwpy works:\r\n\r\n```\r\nPS C:\\src> C:\\venv\\py34/Scripts\\gcc.exe -shared test.c C:\\venv\\py34\\libs\\libpython34.dll.a -Ic:\\python34_x64\\include -lmsvcr100 -o output_py34.pyd\r\n```\r\n\r\nTo make this case able to highlight the issue I had to change `test.c` to make the function use the `PyObject` type in it's prototype:\r\n\r\n```\r\nPS C:\\src> cat .\\test.c\r\n#include \"python.h\"\r\nPyObject* some_function()\r\n{\r\n        PyObject * test = Py_None;\r\n        return test;\r\n}\r\n```"}}