More than likely, you either don’t have DirectX Version 9 installed at all, or it’s corrupted. I had this error myself earlier while trying to play Touhou 9. Here’s a link to the legacy versions of DirectX installer: https://www.microsoft.com/en-us/download/details.aspx?id=35.
Note that this only installs (or installs over old versions of DirectX and it doesn’t touch the latest DirectX 12, so you don’t need to worry about messing things up for newer games.).
If you haven’t already solved this problem, then I’m almost positive that this will. Also, happy ⑨ day!