-2

With the following code:

#include <GL/glfw.h>

int main() {
        glfwInit();
        glfwSleep( 1.0 );
        glfwTerminate();
}

I'm getting this errors

1>------ Build started: Project: tutorialtry6, Configuration: Debug Win32 ------
1>main.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _glfwSleep referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main
1>c:\users\indrajit kurmi\documents\visual studio 2010\Projects\tutorialtry6\Debug\tutorialtry6.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have added opengl32.lib in linker additional dependencies. How do I solve this?

If you know some link of tutorial where they show step by step how to use OpenGL with GLFW please post it.

Jacob Parker
  • 2,546
  • 18
  • 31

1 Answers1

1

Do you realize that you should build the GLFW library first, and then link (because it is not a header-only library) your application against it? If not, then this is what you should do now. If you need more help, come back with some results of your attempts and state clearly what is the problem.

NOTE: There is no need for a complete tutorial on how to do these simple things as long as you understand the general process of how 3rd party libraries are installed and incorporated into your project.

Alexander Shukaev
  • 16,674
  • 8
  • 70
  • 85