How do I install SDL2 to build my project?


#1

I started a SDL2 project on GitHub and decided to install SDL2 on here, to build my project.
I tried apt-get install libsdl2-dev but I just got
`Setting up udev (204-5ubuntu20.19) …

  • udev requires hotplug support, not started …fail!`
    (SDL2 package requires udev)

When I googled, it said it was because the kernel doesn’t support hotplugging, but guess I can’t just swap the kernel, right? (if I can, please tell me how to)

If anybody encountered this problem, please how to avoid this, ether by configuring udev or package itself is okay.

Thanks in advance.


#2

I know nothing about SDL2 but if you need to change the kernel then that won’t be possible :confused:…unless you use an SSH workspace and connect to your own machine. Then it’s definitely possible.


#3

I knew I couldn’t do that. But it seems udev depends on that specific kernel feature. After some more Googling, I found out SDL2 depends on udev because of joystick support. I’m now going to try building it without joystick support and see if it works. Thanks for the reply anyway.


#4

This shell script will get around the upgrade issue:

#!/bin/sh
[ ! "$(grep -A1 '### END INIT INFO' /etc/init.d/udev | grep 'dpkg --configure -a || exit 0')" ] \
&& sudo sed -i 's/### END INIT INFO/### END INIT INFO\
dpkg --configure -a || exit 0/' /etc/init.d/udev

You can run it with this command:

curl https://gist.githubusercontent.com/ryanpcmcquen/7ef4bf8dea788f73d82397c2b9d1d796/raw/udev_dpkg_workaround.sh | bash