Creating SDL2 Window and OpenGL3 context in seperate dll

Hi!
Just to avoid further questions: I have proper SDL2+OpenGL3+GLAD setup (running demos). I use Windows 7 with msvc compiler.

I recently tried to create some kind of wrapper around different windowing systems, including sdl2 (just for my personal project).

So I created seperate .dll which contains class WindowBase and another .dll which contains WindowSDL2 which extends WindowBase.
WindowSDL2 have two pointers:

SDL_Window * window = nullptr;
SDL_GLContext context;

And constructor:

WindowSDL2::WindowSDL2(WindowStyle style, SDL_WindowFlags _flags)
	:WindowBase(style), flags(_flags)
{
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, 
        SDL_GL_CONTEXT_PROFILE_CORE);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
	window = SDL_CreateWindow(style.name, style.posX, style.posY, style.width, style.height, flags);
	context = SDL_GL_CreateContext(window);
	if (!gladLoadGLLoader((GLADloadproc)SDL_GL_GetProcAddress)) {
		std::cout << "Failed to initialize GLAD\n";
	}
}

Three another methods used from those .dlls:

void WindowSDL2::update() {
	swapBuffers();
}
void WindowSDL2::swapBuffers() {
	SDL_GL_SwapWindow(window);
}

void Window::clearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
	glClearColor(r, g, b, a);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

Then I link this .dll with my main.cpp file which has following content:

int main(){
        WindowStyle style("demo", 500, 500, 512, 512);
        WindowSDL2 window(style, SDL_WINDOW_OPENGL);

        bool isRunning = true;
	float r = 0.0f;
	while(isRunning) {
		window.clearColor(r, 0.0f, 0.5f, 1.0f);
		r+=0.001f;
		if (r > 1.f)
			r = 0.f;
		window.update();
	}
	return 0;
}

Program crashes on first call to OpenGL api, which is glClearColor, Visual Studio debugger says that glClearColor’s address is 0x0000000
When I move all code from .dll to main it works.

Is it proper to create SDL2 context and Window in another .dll? I’ve seen that context is seperate for each thread, but as far as I know .dlls are simply loaded to the process
memory and there is no seperate threads for them.
Another hypothesis is that maybe there is problem with GLAD, but I tried moving only gladLoadGLLoader from .dll to main and it still didn’t worked (also it returned true in both cases).

Thanks for any help, I’ve been racking my brain for 3 days and I am a bit lost.