I'm assuming you're on Windows. Which version is it exactly?
SDL provides a feature that lets you select the video driver with an environment variable. The variable is called
SDL_VIDEODRIVER. If you set this environment variable to "directx", SDL 2 will complain that it doesn't have such a driver with "directx not available".
"directx" is a video driver in SDL 1.2. Perhaps you have this environment variable set for your user or system?
SET and press enter. This will list all environment variables. Check if there are any
SDL_* variables set. If you find
SDL_VIDEODRIVER, you can delete it in the appropriate control panel menu. There are a few resources like this on the internet on how to do that.
It's possible that code::blocks has the ability to set environment variables for the programs it is launching. Check in its configuration if there's anything.