# Linking libraries

**URL:** <https://discourse.glfw.org/t/linking-libraries/191>\
**Category:** support\
**Created:** [August 17, 2013, 8:47am UTC](https://discourse.glfw.org/t/linking-libraries/191 "2013-08-17T08:47:27Z")\
**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:** [August 17, 2013, 8:47am UTC](https://discourse.glfw.org/t/linking-libraries/191/1 "2013-08-17T08:47:27Z")

</div>

**[nolane61](https://sourceforge.net/u/nolane61/)** wrote on [Saturday, August 17, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/4f48cb24/#954a):

I just want test glfw.

```
main.cpp:
#include <GL/glfw3.h>
#include <vector>
#include <iostream>
using namespace std;

int main(int argc, char** argv)
{
    glfwInit();

    glfwTerminate();

    int temp;
    cin >> temp;
    return 0;
}

```

I load the lastest Binaries for 64-bit Windows files from “[http://www.glfw.org/download.html](http://www.glfw.org/download.html)”. I use MinGW in Code Blocks 12.11 in Windows 7. When I build siple project which has the only file, I get this build log:

```
-------------- Build: Debug in glfw (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -g -std=c++11 -I"C:\Program Files (x86)\CodeBlocks\MinGW\include" -c C:\glfw\main.cpp -o obj\Debug\main.o
g++.exe -L"C:\Program Files (x86)\CodeBlocks\MinGW\lib" -o bin\Debug\glfw.exe obj\Debug\main.o -lglfw3 -lopengl32 
obj\Debug\main.o: In function `main':
C:/glfw/main.cpp:8: undefined reference to `glfwInit'
C:/glfw/main.cpp:10: undefined reference to `glfwTerminate'
collect2.exe: error: ld returned 1 exit status

```

“C:\Program Files (x86)\CodeBlocks\MinGW\lib” contains libglfw3.a and libopengl32.a.

What’s my fault?

---

<div class="post-metadata">

**Author:** ![devel-chm](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/devel-chm/32/119_2.png) [@devel-chm](https://discourse.glfw.org/u/devel-chm)\
**Post date:** [February 25, 2018, 9:37pm UTC](https://discourse.glfw.org/t/linking-libraries/191/3 "2018-02-25T21:37:21Z")

</div>

I’m not familiar with Code Blocks but the error message indicates that the glfw3 library is not being found. Does it work if you use the pathname for the library instead?
