Page 1 of 1

Getting SDL2 installed in cygwin

Posted: Mon Feb 08, 2021 7:47 pm
by Mu0n

I haven't used a unix based OS in the last 20 years, so on top of being very rusty, I'm new to the whole package getting/updating through the internet. I used an already old X11 terminal back at my university between 2000-2002 and just did the bare minimum to compile my C physics code.

As an entry point to testing out the x16 emulator, I started watching SlithyMatt's excellent youtube series and followed the readme instructions on his repo here: https://github.com/SlithyMatt/x16-assembly-tutorial Note that I'm using a Win10 machine.

1) I installed cygwin with these packages ticked in during setup: git, gcc-core and make. I suspect that at this step, something needs to be done with SDL2 as well, as I hit a brick wall down below.

2) I went with symbolic links within cygwin rather than win10 path environment variables

3) I successfully git cloned, then compiled cc65, the x16 rom (I got a complain about not finding ld65.exe during that step, but I added the symbolic link to it as well, which made it work), but not the x16 emulator

4) Compiling the emulator gets me: 


Quote




In file included from cpu/fake6502.c:107:

cpu/../debugger.h:15:10: fatal error: SDL.h: No such file or directory

   15 | #include <SDL.h>



 which leads me to think I'm not getting something fundamental with installing the SDL2 source within cygwin, a step for which most of you wouldn't bat an eye, but which baffles this mostly MS-DOS veteran.

I know I can download the emulator binary and rom and just forget about this step - though it's useful to constantly refresh versions with git. I know I can run code in the web emulator, but I want to understand where I'm going wrong and fix it, this will increase my unix knowledge and maybe help me elsewhere (ie raspbian on my pi3).

 


Getting SDL2 installed in cygwin

Posted: Mon Feb 08, 2021 7:58 pm
by SlithyMatt

I don't know if a Cygwin build of the emulator itself will work -- I never tried that. There is the libSDL2-devel package, but I don't know if it will actually work. For Windows, I recommend using the release build of the emulator for Windows (which the dev team uses a Mac to build) and just use Cygwin for building and running cc65.


Getting SDL2 installed in cygwin

Posted: Tue Feb 09, 2021 8:14 am
by Ender

If you really want to compile it yourself in Windows for Windows, I've done it inside of MSYS, although I had to make some changes to the Makefile.  Compiling things for Windows is easier in MSYS than Cygwin because you don't have to worry about cross-compiling. If you're interested I could dig through what I've done and post more about it later (I mostly forget what I did off the top of my head).