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();