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

Error trying to build on Windows (pygame_sdl2.event.c) #139

Closed
iampham opened this issue Jul 6, 2022 · 4 comments
Closed

Error trying to build on Windows (pygame_sdl2.event.c) #139

iampham opened this issue Jul 6, 2022 · 4 comments

Comments

@iampham
Copy link

iampham commented Jul 6, 2022

I've followed the instructions listed on the documentation in the README:

  1. I've put pygame_sdl2_windeps into the pygame_sdl2 checkout
  2. I've installed the prerequisite libraries/compilers (future, cython, Microsoft Visual C++, etc.)

As soon as I run python setup.py install, the build runs smoothly until I get the following error:

building 'pygame_sdl2.event' extension
(path stuff)...
pygame_sdl2.event.c
gen3\pygame_sdl2.event.c(11491): error C2065: 'SDL_DISPLAYEVENT': undeclared identifier
gen3\pygame_sdl2.event.c(11575): error C2065: 'SDL_KEYMAPCHANGED': undeclared identifier
gen3\pygame_sdl2.event.c(11887): error C2065: 'SDL_DROPTEXT': undeclared identifier
gen3\pygame_sdl2.event.c(11899): error C2065: 'SDL_DROPBEGIN': undeclared identifier
gen3\pygame_sdl2.event.c(11911): error C2065: 'SDL_DROPCOMPLETE': undeclared identifier
gen3\pygame_sdl2.event.c(11923): error C2065: 'SDL_AUDIODEVICEADDED': undeclared identifier
gen3\pygame_sdl2.event.c(11935): error C2065: 'SDL_AUDIODEVICEREMOVED': undeclared identifier
gen3\pygame_sdl2.event.c(11947): error C2065: 'SDL_SENSORUPDATE': undeclared identifier
gen3\pygame_sdl2.event.c(11971): error C2065: 'SDL_RENDER_DEVICE_RESET': undeclared identifier
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

Other files before pygame_sdl2.event.c seem to have built succesfully. The build gets hung on this specific file. Is there any known fix/am I doing something stupid?

Thanks for the help!

@DaryeDev
Copy link

Have the same issue. Bump.

@renpytom
Copy link
Member

I don't have experience building this with MSVC, so I can't help here. At this point, I'm not expecting pygame_sdl2 to be used outside of Ren'Py.

@J-Wedekind
Copy link

Recently I tried to build a new version and stumbled upon the same problems.
Can't remember the full process of when I build it for the first time, but I remember it took me about a week of fiddling around and I still got some notes from then:

LNK2001: SDL-devel gotta be properly installed / linked and don't use a virtualenv.

Python.h not found: don't use a virtualenv or copy the include dir containing the python.h from the Python home dir to the root of the virtualenv.

C2065: Install latest VC and C++ BuildTools for your version of VisualStudio and add path to path variables.. also building process seems to favor the newest install in your path, but building may only work on VisualStudio 2015 to 2017 for some reason.

+Also check if your python setuptools is up to date.

I hope for this to help somebody out at least a bit and I'd be glad if someone figures out more.^^

@Borohydride
Copy link

I used newer versions of SDL2 source code to replace the files in pygame_sdl2_windeps, and successfully built the wheel.

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

No branches or pull requests

5 participants