I am trying to make a window with c++ and SDL, But when I launch my code, it says "The code execution cannot proceed because SDL2.dll was not found." And yes, it is confusing because I have SDL2.dll in my source files. Do anyone know how to fix it.?
Code:
#include "SDL.h"
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window* window = SDL_CreateWindow("title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN);
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, 0);
SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
SDL_Delay(3000);
return 0;
}
You may either manually copypaste it to your final build folder, or add this file to a project and specify its build action as Copy to Output (it used to work for me).
I think there may be option to set up a working directory in a project settings as well.