# Undefined references errors when getting started with glwf

**URL:** <https://discourse.glfw.org/t/undefined-references-errors-when-getting-started-with-glwf/592>\
**Category:** support\
**Created:** [July 9, 2013, 1:15pm UTC](https://discourse.glfw.org/t/undefined-references-errors-when-getting-started-with-glwf/592 "2013-07-09T13:15:29Z")\
**Posts on this page:** 3\
**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:** [July 9, 2013, 1:15pm UTC](https://discourse.glfw.org/t/undefined-references-errors-when-getting-started-with-glwf/592/1 "2013-07-09T13:15:29Z")

</div>

**[mandelcreme](https://sourceforge.net/u/mandelcreme/)** wrote on [Tuesday, July 09, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/9ebad4f2/#e187):

Hi there.

I just started to program with glfw. While trying to create a simple window I always get these undefined reference errors: (not be surprised, I’m german)

```
#!cpp
Fehler:undefined reference to `_imp__glfwInit'    
Fehler:undefined reference to `_imp__glfwCreateWindow'    
Fehler:undefined reference to `_imp__glfwTerminate'    
Fehler:undefined reference to `_imp__glfwMakeContextCurrent'    
Fehler:undefined reference to `_imp__glfwSwapBuffers'    
Fehler:undefined reference to `_imp__glfwPollEvents'    
Fehler:undefined reference to `_imp__glfwWindowShouldClose'    
Fehler:undefined reference to `_imp__glfwTerminate'    
collect2.exe:-1: Fehler:error: ld returned 1 exit status    

```

In this case I use the glfw3dll library. When I use the glfw3 library the error messages are the same, but without “_imp_\_”.

That is how my .pro-file looks like:

```
#!cpp
TEMPLATE = app
CONFIG += console
CONFIG -= qt

SOURCES += main.cpp \

LIBS += -lglfw3dll -lopengl32 -lglu32

```

The libraries will be found. But it seems that there are some linker problems.

That is my main-file:

```
#!cpp
#define GLFW_DLL
#include <GLFW/glfw3.h>

using namespace std;

int main()
{
    GLFWwindow* window;

    // initialize library
    if(!glfwInit()){
        return -1;
    }

    window = glfwCreateWindow(640,480,"Test", NULL, NULL);

    if(!window){
        glfwTerminate();
        return -1;
    }

    glfwMakeContextCurrent(window);

    while(!glfwWindowShouldClose(window)){

       glfwSwapBuffers(window);

       glfwPollEvents();
    }

    glfwTerminate();

    return 0;
}

```

I have seen the other threads about almost the same problem. But they didn’t help me.  
Can anybody tell me, what I’m doing wrong?

Note: I use the Qt Creator 5.1.0.

Many thanks in advance.

---

<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:** [July 10, 2013, 9:49pm UTC](https://discourse.glfw.org/t/undefined-references-errors-when-getting-started-with-glwf/592/2 "2013-07-10T21:49:57Z")

</div>

**[phoenix94](https://sourceforge.net/u/phoenix94/)** wrote on [Wednesday, July 10, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/9ebad4f2/#e187/adfb):

Which platform are you using? Linux, Windows, Max, Version, etc.?

Maybe you used the wrong library? E.g. 64Bit on 32Bit?

But I know these Problems. I need hours to get OpenGl 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:** [July 13, 2013, 9:05am UTC](https://discourse.glfw.org/t/undefined-references-errors-when-getting-started-with-glwf/592/3 "2013-07-13T09:05:45Z")

</div>

**[mandelcreme](https://sourceforge.net/u/mandelcreme/)** wrote on [Saturday, July 13, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/9ebad4f2/#4647):

Hi,

I’m using Wondows 7 (64 bit).  
And yes, I tried to work with the 64Bit library, but without having MS Visual C++ 2012 installed…

The 32Bit library works. But I still would like to use the 64Bit. Now I have the MS Visual C++ 2012 redistributable. But it seems that I also need MinGW-w64.

So, I’m still working on it…

Thanks for your answer.
