MiddleKay
MiddleKay

Reputation: 319

LNK2019: unresolved external symbol _glfwInit referenced in function _main

This bit of code I followed from this tutorial

#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include "Test2.h"

using namespace glm;

int main()
{
    if(!glfwInit())
    {
        fprintf(stderr, "Failed to initialize GLFW\n");
        return - 1;
    }
}

And it generated an error: LNK2019: unresolved external symbol _glfwInit referenced in function _main

I'm using VC++ 2008. I downloaded glfw-2.7.6.bin.WIN32.zip from glfw's official site, copied dll from the folder named lib-msvc90 to system32, and the lib to Microsoft SDKs. Any step I missed?

Upvotes: 2

Views: 8192

Answers (1)

Calvin1602
Calvin1602

Reputation: 9547

Any step I missed?

YES

Please READ the 1rst tutorial. It explicitly states that you should use CMake instead of rolling your own Visual project. And there is no need to download GLFW, it's already bundled in external/. Same thing for GLEW and GLM.

There is also the FAQ, and a special tutorial if you really want to do it yourself.

Upvotes: 2

Related Questions