Jump to content
  • Advertisement
test opty

OpenGL Linker errors when setting up VS 2017 for OpenGL

Recommended Posts

Hello all,

I set up Visual Studio 2017 for OpenGL and ran this and this codes successfully.

I get these linker errors when compiling the following code:

#include <iostream>
using namespace std;
#include "vgl.h"
#include "LoadShaders.h"

enum VAO_IDs { Triangles, NumVAOs };
enum Buffer_IDs { ArrayBuffer, NumBuffers };
enum Attrib_IDs { vPosition = 0 };
GLuint VAOs[NumVAOs];
GLuint Buffers[NumBuffers];
const GLuint NumVertices = 6;
// init
    static const GLfloat vertices[NumVertices][2] =
        { -0.90, -0.90 }, // Triangle 1
        { 0.85, -0.90 },
        { -0.90, 0.85 },
        { 0.90, -0.85 }, // Triangle 2
        { 0.90, 0.90 },
        { -0.85, 0.90 }
    glCreateBuffers(NumBuffers, Buffers);
    glNamedBufferStorage(Buffers[ArrayBuffer], sizeof(vertices),
        vertices, 0);
    ShaderInfo shaders[] = {
        { GL_VERTEX_SHADER, "triangles.vert" },
        { GL_FRAGMENT_SHADER, "triangles.frag" },
        { GL_NONE, NULL }
    GLuint program = LoadShaders(shaders);
    glGenVertexArrays(NumVAOs, VAOs);
    glBindBuffer(GL_ARRAY_BUFFER, Buffers[ArrayBuffer]);
    glVertexAttribPointer(vPosition, 2, GL_FLOAT,
        GL_FALSE, 0, BUFFER_OFFSET(0));
// display
    static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f };
    glClearBufferfv(GL_COLOR, 0, black);
    glDrawArrays(GL_TRIANGLES, 0, NumVertices);
// main
main(int argc, char** argv)
    GLFWwindow* window = glfwCreateWindow(640, 480, "Triangles", NULL,

    while (!glfwWindowShouldClose(window))



Is there any way to solve this issue?





Edited by test opty

Share this post

Link to post
Share on other sites

looks to me like you are trying to use GL3W now after trying out GLAD and didn't swap out the c files. 


edit: Just now, I've upgraded opengl function pointer loading from GLEW to GL3W in my personal framework. Took a touch of google to help with the transition, but the experience was satisfying. Worth the effort? pfffttt...but its done.

Edited by GoliathForge

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!