Can't compile example from GLFW website (Undefined references to GLFW functions)

Hello, i have dowloaded the Windows precompiled binaries and putted:

glfw3.dll on SysWOW64

In order of linked in CodeBlocks: libglfw3.a, libopengl32.a, libglu32.a, libgdi32.a on C:\MinGW\lib

In C:\MinGW\include\GL\ i have gl.h, glext.h, glfw3.h, glfw3native.h and glu.h

The code i attempt to compile is this:

#include <GL/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
static void error_callback(int error, const char* description)
{
    fputs(description, stderr);
}
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
    if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
        glfwSetWindowShouldClose(window, GL_TRUE);
}
int main(void)
{
    GLFWwindow* window;
    glfwSetErrorCallback(error_callback);
    if (!glfwInit())
        exit(EXIT_FAILURE);
    window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        exit(EXIT_FAILURE);
    }
    glfwMakeContextCurrent(window);
    glfwSetKeyCallback(window, key_callback);
    while (!glfwWindowShouldClose(window))
    {
        float ratio;
        int width, height;
        glfwGetFramebufferSize(window, &width, &height);
        ratio = width / (float) height;
        glViewport(0, 0, width, height);
        glClear(GL_COLOR_BUFFER_BIT);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f);
        glBegin(GL_TRIANGLES);
        glColor3f(1.f, 0.f, 0.f);
        glVertex3f(-0.6f, -0.4f, 0.f);
        glColor3f(0.f, 1.f, 0.f);
        glVertex3f(0.6f, -0.4f, 0.f);
        glColor3f(0.f, 0.f, 1.f);
        glVertex3f(0.f, 0.6f, 0.f);
        glEnd();
        glfwSwapBuffers(window);
        glfwPollEvents();
    }
    glfwDestroyWindow(window);
    glfwTerminate();
    exit(EXIT_SUCCESS);
}

My pc is Win8.1 64bit and i’m getting this errors:

||=== Build: Debug in SIM (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function key_callback':| C:\Users\Marc\Documents\C++\SIM\main.cpp|11|undefined reference toglfwSetWindowShouldClose’|
obj\Debug\main.o||In function main':| C:\Users\Marc\Documents\C++\SIM\main.cpp|16|undefined reference toglfwSetErrorCallback’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|17|undefined reference to glfwInit'| C:\Users\Marc\Documents\C++\SIM\main.cpp|19|undefined reference toglfwCreateWindow’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|22|undefined reference to glfwTerminate'| C:\Users\Marc\Documents\C++\SIM\main.cpp|25|undefined reference toglfwMakeContextCurrent’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|26|undefined reference to glfwSetKeyCallback'| C:\Users\Marc\Documents\C++\SIM\main.cpp|31|undefined reference toglfwGetFramebufferSize’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|40|undefined reference to glfwGetTime'| C:\Users\Marc\Documents\C++\SIM\main.cpp|49|undefined reference toglfwSwapBuffers’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|50|undefined reference to glfwPollEvents'| C:\Users\Marc\Documents\C++\SIM\main.cpp|27|undefined reference toglfwWindowShouldClose’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|52|undefined reference to glfwDestroyWindow'| C:\Users\Marc\Documents\C++\SIM\main.cpp|53|undefined reference toglfwTerminate’|
||=== Build failed: 14 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I get errors at all glfw functions.

Whhat i do have messed up?

[QUOTE=Marc Colomé;1261411]Hello, i have dowloaded the Windows precompiled binaries and putted:

glfw3.dll on SysWOW64
[/QUOTE]
Don’t ever do this! This isn’t a Unix® system. The library goes into the same directory as the application binary.

Did you copy the glfw libraries into the MinGW lib directory? Same thing as above. Put them in some directory that contains your programs dependencies (same for the headers).

[QUOTE=Marc Colomé;1261411]
||=== Build: Debug in SIM (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function key_callback':| C:\Users\Marc\Documents\C++\SIM\main.cpp|11|undefined reference toglfwSetWindowShouldClose’|
obj\Debug\main.o||In function main':| C:\Users\Marc\Documents\C++\SIM\main.cpp|16|undefined reference toglfwSetErrorCallback’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|17|undefined reference to glfwInit'| C:\Users\Marc\Documents\C++\SIM\main.cpp|19|undefined reference toglfwCreateWindow’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|22|undefined reference to glfwTerminate'| C:\Users\Marc\Documents\C++\SIM\main.cpp|25|undefined reference toglfwMakeContextCurrent’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|26|undefined reference to glfwSetKeyCallback'| C:\Users\Marc\Documents\C++\SIM\main.cpp|31|undefined reference toglfwGetFramebufferSize’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|40|undefined reference to glfwGetTime'| C:\Users\Marc\Documents\C++\SIM\main.cpp|49|undefined reference toglfwSwapBuffers’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|50|undefined reference to glfwPollEvents'| C:\Users\Marc\Documents\C++\SIM\main.cpp|27|undefined reference toglfwWindowShouldClose’|
C:\Users\Marc\Documents\C++\SIM\main.cpp|52|undefined reference to glfwDestroyWindow'| C:\Users\Marc\Documents\C++\SIM\main.cpp|53|undefined reference toglfwTerminate’|
||=== Build failed: 14 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I get errors at all glfw functions.

Whhat i do have messed up?[/QUOTE]
You oviously didn’t link against GLFW. The linker flag “-lglfw” should be set. The IDE you use should have some menu where you can point it at the GLFW library directory and specify what libraries to link against.