User forums > Using Code::Blocks
Linking GLFW
(1/1)
Spackotus:
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?
BlueHazzard:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Spackotus:
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)
--- End code ---
For me it looks fine...
BlueHazzard:
--- Quote from: Spackotus on December 14, 2013, 11:38:45 am ---For me it looks fine...
--- End quote ---
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
--- End code ---
you have added this in the wrong place...
you have to add it in linker libryries
greetings
Navigation
[0] Message Index
Go to full version