0

I have a problem i'm using GLFW with VS 2013 Community Edition And I get this error:

1>------ Build started: Project: [F]Mod, Configuration: Debug Win32 ------
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>glfw3.lib(window.c.obj) : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _glfwCreateWindow
1>glfw3.lib(context.c.obj) : error LNK2019: unresolved external symbol __imp__glGetIntegerv@8 referenced in function __glfwRefreshContextAttribs
1>glfw3.lib(context.c.obj) : error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function _glfwExtensionSupported
1>glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function __glfwCreateContext
1>glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function __glfwDestroyContext
1>glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function __glfwPlatformGetProcAddress
1>glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function __glfwPlatformMakeContextCurrent
1>glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__wglShareLists@8 referenced in function __glfwCreateContext
1>c:\users\finn\documents\visual studio 2013\Projects\[F]Mod\Debug\[F]Mod.exe : fatal error LNK1120: 8 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So I tried using the 32-bit Binaries instead no change :(

Edit: Yes, My problem is very similar to this question, the answer that Chris Dargis suggested (Add opengl32.lib) did not work, although it did produce a different set of errors:

1>------ Build started: Project: [F]Mod, Configuration: Debug Win32 ------
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function "void __cdecl WindowCreate(void)" (?WindowCreate@@YAXXZ)
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function "void __cdecl WindowCreate(void)" (?WindowCreate@@YAXXZ)
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function "void __cdecl WindowUpdate(void)" (?WindowUpdate@@YAXXZ)
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function "void __cdecl WindowUpdate(void)" (?WindowUpdate@@YAXXZ)
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function "void __cdecl WindowCreate(void)" (?WindowCreate@@YAXXZ)
1>WindowFunctions.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function "void __cdecl WindowUpdate(void)" (?WindowUpdate@@YAXXZ)
1>c:\users\finn\documents\visual studio 2013\Projects\[F]Mod\Debug\[F]Mod.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

now it says the unresolved external is in my WindowFunctions.obj i'm not too sure whats going on :-( I'm new to glfw and I've never really used vs that much.

BTW: My Code Is:

Main.cpp

#include "glfw3.h"
#include "WindowFunctions.h"

int main() {

    WindowCreate();
    WindowUpdate();
    WindowEnd();

    return 0;

}

WindowFunctions.cpp

#include "WindowFunctions.h"
#include "glfw3.h"
#include <iostream>

GLFWwindow* Window;

// Setup Voids
void WindowCreate() {

    // Setup Window
    Window = glfwCreateWindow(640, 480, "[F]Mod", NULL, NULL);

    // If GLFW Fails
    if (!Window) {
        glfwTerminate();
        std::cout << "Error 01: GLFW Failed To Start Window" << std::endl;
    }

    glfwMakeContextCurrent(Window);

}

void WindowUpdate() {

    while (!glfwWindowShouldClose(Window))
    {

        // Constant Operations
        glfwSwapBuffers(Window);
        glfwPollEvents();

    }

}


void WindowEnd() {

    glfwTerminate();

}

WindowFunctions.h

//Window Functions
void WindowCreate();
void WindowUpdate();
void WindowEnd();

Project Download

Community
  • 1
  • 1
finnthomas
  • 23
  • 1
  • 9
  • possible duplicate of [VC++ LNK Errors With GLFW](http://stackoverflow.com/questions/11605835/vc-lnk-errors-with-glfw) – Retired Ninja Apr 19 '15 at 11:56
  • This may help as well: http://stackoverflow.com/questions/13889255/glfw-linking-issue-visual-studio-2012 When you have issues like this it's because you're missing one or more libraries. If you add one and it changes the errors then you're missing another one. You can usually tell by the name what is missing, or you can search for part of the error message like "unresolved external symbol _glfwTerminate". – Retired Ninja Apr 21 '15 at 00:09

0 Answers0