Author Topic: Linking GLFW  (Read 6509 times)

Offline Spackotus

  • Single posting newcomer
  • *
  • Posts: 2
Linking GLFW
« on: December 14, 2013, 01:15:10 am »
Jeah i know, there are a lot of posts for glfw...

Well, there is the new GLFW version 3.03 and with the new version the project template doesnt work...

I tried making an empty project and made a global variable glfw3 with the right paths. Next i put $(#glfw3.include) in SearchDirectory/Compiler and $(#glfw3.lib) in SearchDirectory/Linker.
I guess its all, i shold do...  ???

Bit i get "undefined reference to" Errors -> I suppose it is a linker problem...

But if I put the right lib (libglfw3.a) to the LinkerSettings nothing happens...


does anyone have an idea?


Offline Spackotus

  • Single posting newcomer
  • *
  • Posts: 2
Re: Linking GLFW
« Reply #2 on: December 14, 2013, 11:38:45 am »
I folowed it somehow... Well, I cant building from command line, I never dit that before... ???
On the other hand this is the build log:

Code
-------------- Clean: Debug in ExtensionTest1 (compiler: GNU GCC Compiler)---------------

Cleaned "ExtensionTest1 - Debug"

-------------- Build: Debug in ExtensionTest1 (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall  -g    -IC:\Users\Oleg\Libs\glfw-3.0.3.bin.WIN64\include  -c C:\Users\Oleg\Projects\OpenGL\ExtensionTest1\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\Users\Oleg\Libs\glfw-3.0.3.bin.WIN64\lib-mingw  -o bin\Debug\ExtensionTest1.exe obj\Debug\main.o    ..\..\..\Libs\glfw-3.0.3.bin.WIN64\lib-mingw\libglfw3.a C:\Users\Oleg\Libs\glfw-3.0.3.bin.WIN64\lib-mingw\libglfw3.a
obj\Debug\main.o: In function `main':
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:8: undefined reference to `glfwInit'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:12: undefined reference to `glfwCreateWindow'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:15: undefined reference to `glfwTerminate'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:20: undefined reference to `glfwMakeContextCurrent'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:28: undefined reference to `glfwSwapBuffers'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:31: undefined reference to `glfwPollEvents'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:23: undefined reference to `glfwWindowShouldClose'
C:/Users/Oleg/Projects/OpenGL/ExtensionTest1/main.cpp:34: undefined reference to `glfwTerminate'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
8 errors, 0 warnings (0 minutes, 1 seconds)

For me it looks fine...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Linking GLFW
« Reply #3 on: December 14, 2013, 01:46:00 pm »
For me it looks fine...

Well you get errors, sou obviously something is wrong ;)

in your build log:
Code
..\..\..\Libs\glfw-3.0.3.bin.WIN64\lib-mingw\libglfw3.a C:\Users\Oleg\Libs\glfw-3.0.3.bin.WIN64\lib-mingw\libglfw3.a

you have added this in the wrong place...
you have to add it in linker libryries

greetings