I'm working with OpenGL and trying to include GLAD into my project, however I'm unsure where to link the glad.c
I'm getting the error
Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol gladLoadGLLoader referenced in function "public: __cdecl zelmEngineCore::zelmEngineCore(void)" (??0zelmEngineCore@@QEAA@XZ) OpenGLGLFWTestApp
My dependencies file is as so
#pragma once
#ifdef _WIN64
#include <Windows.h>
#endif
#include <string>
#include <iostream>
#include <vector>
#include <glad\glad.h>
#include <GLFW\glfw3.h>
I'm calling -
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress;
From the constructor of zelmEngineCore.
Here the constructor
#include "zelmDependencies.h"
#include "zelmEngineWindow.h"
zelmEngineCore::zelmEngineCore()
{
if (!glfwInit())
{
std::cout << "Error: Couldn't initalise glfw!";
}
//Set error callback function
//glfwSetErrorCallback(zelmEngineCore::glfwErrorCallback);
//Before creation of the window, you can set the minimum OpenGL
//version, but we're not using openGL, so it not needed
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress); //Causing the unresolved exteral symbol
}
zelmEngineCore::~zelmEngineCore()
{
glfwTerminate();
}
My zelmEngineCore class is as follows -
#pragma once
#include "zelmDependencies.h"
#include "zelmEngineWindow.h"
class zelmEngineCore
{
private:
protected:
public:
zelmEngineCore();
~zelmEngineCore();
};
And here main.cpp
#include "zelmEngine\zelmEngineCore.h"
int main()
{
zelmEngineCore engine;
return 0;
}
This my C/C++ / General additional directories includes, I impression I haven't included glad.c file properly. I tried including it in the Linker, but I also get impression Linker is used for .lib(s) includes.