# glfwSetWindowSizeCallback HELP please!

**URL:** <https://discourse.glfw.org/t/glfwsetwindowsizecallback-help-please/293>\
**Category:** support\
**Created:** [December 20, 2010, 3:26am UTC](https://discourse.glfw.org/t/glfwsetwindowsizecallback-help-please/293 "2010-12-20T03:26:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [December 20, 2010, 3:26am UTC](https://discourse.glfw.org/t/glfwsetwindowsizecallback-help-please/293/1 "2010-12-20T03:26:53Z")

</div>

**[chutiano](https://sourceforge.net/u/chutiano/)** wrote on [Monday, December 20, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/9b34861b/#7dc3):

Hi guys newbie trying to get my window resize to work but am getting this  
error:

CODE:

```
class Renderer 
{
	bool loop_running;
public:
	 Renderer();
	~Renderer();
	static void GLFWCALL GLFWResizeCallback( int width, int height );
	void ResizeGL(int width , int height);
	void InitGL();
	void RenderLoop();
	static Renderer *mainRenderer;
};
Renderer::Renderer()
{
	
	mainRenderer = this;
	
	glfwSetWindowSizeCallback(GLFWResizeCallback);
	
}
void GLFWCALL Renderer::GLFWResizeCallback( int width, int height )
{
	Renderer::mainRenderer->ResizeGL(width, height);
}

```

VS2010 ERROR:

```
1>------ Build started: Project: Basecode3, Configuration: Debug Win32 ------
1>Build started 20/12/2010 2:11:13 PM.
1>InitializeBuildStatus:
1> Touching "Debug\Basecode3.unsuccessfulbuild".
1>ClCompile:
1> Renderer.cpp
1> Generating Code...
1> Compiling...
1> main.cpp
1> Generating Code...
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>Renderer.obj : error LNK2001: unresolved external symbol "public: static class Renderer * Renderer::mainRenderer" (?mainRenderer@Renderer@@2PAV1@A)
1>C:\CODE\Renderer\Basecode3\Debug\Basecode3.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.29
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

```

need help really stuck.

p.s. Ioving GLFW keep up the good work!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [January 21, 2011, 1:21am UTC](https://discourse.glfw.org/t/glfwsetwindowsizecallback-help-please/293/2 "2011-01-21T01:21:21Z")

</div>

**anonymous** wrote on [Friday, January 21, 2011](https://sourceforge.net/p/glfw/discussion/247562/thread/9b34861b/#7d9f):

Hi,

You’ll need to declare the callback function as GLFWCALL, eg:

```
class Blah{
    static void GLFWCALL OnWindowSize( int width,int height );
};
//...etc...//
void Blah::OnWindowSize( int width,int height ){
}

```

Bye!  
Mark
