Errors in visual studio before building solution

I have had 12 errors which concerned missing header files like SDL2 and so on.
Then, after an building a project those errors have dissappeared, why have this happend?