-2

i've tried to make a basic glfw terminal application, wich is only made to test the header files and dll's, and i continualy receive the error code: "undefined reference to '__imp_glfwInit' " when compiling.

current os: windows 11

kde: vs code

additional information: the header files and dll's of glfw are in the same folder as the main.cpp

edit: the problem has solved after including the flag "-lglfw3" after the main.cpp, my mistake is that i was including it before main.cpp.

Rabbid76
  • 177,135
  • 25
  • 101
  • 146
Bitto
  • 1
  • 1
  • What GLFW tutorial are you following? It should mention that you need to add `-lglfw3` to the linker flags. – HolyBlackCat May 19 '22 at 12:55
  • i was following the instructions in the glfw official site documentation, also i'm using "g++ -I. -L. -lglfw3 -O main.cpp" as the compiler arguments – Bitto May 19 '22 at 13:06
  • The information about the flags should've been included in the question. `-lglfw3` must be to the right of `main.cpp`. – HolyBlackCat May 19 '22 at 13:07
  • 1
    sorry about that, next time i'll include the compiler flags, and thanks! after typing -lglfw3 in the right of `main.cpp` the program has compiled correctly – Bitto May 19 '22 at 13:13

0 Answers0