I loved the first Mafia game and really disliked the Mafia 3, so I decided to bring back old good memories and installed Mafia 2 on my Windows 10 64 bit computer. Once the installation was completed I couldn’t launch the game because d3dx9_42.dll is missing from your computer error appeared right upon launching the Mafia 2 Launcher. I tried various methods that I found on the Internet, in particular, running the came with Windows 7 compatibility mode, running as administrator and even reinstalled the game few times, however the d3dx9_42.dll is missing error still appeared and prevented me from running the game. Since the Mafia 2 game is quite old I was unable to find recent fixes and solutions for d3dx9_42.dll is missing error, so I started to experiment by myself and suddenly I managed to fix the problem.
I found that d3dx9_42.dll is a system library that might be damaged or corrupted for various reasons. Some users saying that reinstalling DirectX might solve the problem, however it didn’t help in my case, since Windows 10 runs the DirectX 10 version and d3dx9_42.dll belongs to DirectX 9 version. So, in order to fix d3dx9_42.dll is missing in Mafia 2 I decided to trick the system and manually downloaded the d3dx9_42.dll file from here: https://fix4dll.com/d3dx9_42_dll. After downloading the library, I followed the installation instructions provided on the website and rebooted my computer. After that, I was able to launch Mafia 2 game.
If it was helpful for you too, do not hesitate to like and share this guide with your friends.