Pergunta

I'm trying to create a GLFW project, but I'm getting LNK2019 errors with the basic setup.

  1. I've downloaded the latest binary (glfw-3.0.bin.WIN32.zip) to a folder.
  2. I've created a new, empty console project.
  3. Within VC++ Directories, I've added the following line to include directories:

    C:\C++Libraries\glfw-3.0.bin.WIN32\include

  4. I've added the following line to the Library Directories:

    C:\C++Libraries\glfw-3.0.bin.WIN32\lib-msvc110

  5. I've linked the following libraries:

opengl32.lib, glfw3.lib, glfw3dll.lib

  1. From the latest tutorial, I paste into my project (no visible syntax errors) to test, but I get four LNK2019 errors after trying to run it.

    Here are the errors:

    Error   2   error LNK2019: unresolved external symbol __imp__joyGetPosEx@8
    referenced in function __glfwPlatformGetJoystickAxes    
    c:\Users\Spicy Weenie\documents\visual studio 2012\
    Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
    
    Error   3   error LNK2019: unresolved external symbol __imp__joyGetDevCapsW@12  
    referenced in function __glfwPlatformGetJoystickAxes    
    c:\Users\Spicy Weenie\documents\visual studio  
    2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
    
    Error   4   error LNK2019: unresolved external symbol __imp__joyGetPos@8
    referenced in function __glfwPlatformJoystickPresent    
    c:\Users\Spicy Weenie\documents\visual studio
    2012\Projects\Beta\Beta\glfw3.lib(win32_joystick.obj)
    
    Error   1   error LNK2019: unresolved external symbol __imp__timeGetTime@0
    referenced in function __glfwInitTimer  c:\Users\Spicy Weenie\documents\visual 
    studio 2012\Projects\Beta\Beta\glfw3.lib(win32_time.obj)
    
Foi útil?

Solução

You need to link in at least winmm.lib for timeGetTime. The joystick code is probably in there to.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top