permafrost-engine icon indicating copy to clipboard operation
permafrost-engine copied to clipboard

SDL2 linker issue building

Open ColeW-Picaro opened this issue 3 years ago • 4 comments

Following the build instructions for windows, and make pf PLAT=WINDOWS fails when building on windows. I get this error: image

Other sources say this normally comes in the python-dev package, but that's not available for windows.

ColeW-Picaro avatar May 12 '21 22:05 ColeW-Picaro

Did you do a make deps PLAT=WINDOWS to build CPython before this step? This file is generated during the Python build process and has some config-specific and platform-specific stuff.

eduard-permyakov avatar May 13 '21 07:05 eduard-permyakov

I did, but it looks like it errored building SDL2 without me noticing. Getting a lot of linking errors when running make deps: 2021-05-13-145632_1867x651_scrot

I'm on Linux now, by the way. I'm gonna rename this.

ColeW-Picaro avatar May 13 '21 19:05 ColeW-Picaro

Okay, so there's no real "secret sauce" to the SDL build. The top-level Makefile essentially just calls make in the SDL2 directory, which builds the unmodified source in a standard manner.

As a first experiment, try to clone the default SDL (ex. from here: https://github.com/libsdl-org/SDL) and do ./configure followed by make. If it doesn't work, then you have a problem on your side with your toolchain or something.

It the default SDL build works, then just double check you're not mixing make deps and make deps PLAT=WINDOWS (I noticed you mismatched them in your 2 comments). Also make sure you're either building from a Linux box (recommended) or from Windows using MSYS, and not from something like macOS. If those checks pass, try make clean_deps and re-build. Let me know how it goes.

P.S. As a workaround you can also just copy SDL2.dll to the ./lib directory.

eduard-permyakov avatar May 13 '21 20:05 eduard-permyakov

I mismatched them in my comments because I've tried on both Windows and Linux. I'm trying on Linux right now.

I built SDL and it looks like it linked properly. I ran make clean_deps and make deps again and got the same errors. Here's a screenshot with where they differ. Running make deps on the left, running make for SDL on the right. 2021-05-14-184100_1879x1008_scrot

Looks like SDL built. The warning at the bottom is from a test, so I don't think the build failed.

ColeW-Picaro avatar May 14 '21 22:05 ColeW-Picaro

SDL2 bumped to 2.30.0

eduard-permyakov avatar Mar 06 '24 14:03 eduard-permyakov