This question already has an answer here:
- What is an undefined reference/unresolved external symbol error and how do I fix it? 32 answers
while I am compiling my opengl code I am facing this error.how to remove this?
all: sample2D
sample2D: Sample_GL3_2D.cpp glad.c
g++ -o sample2D Sample_GL3_2D.cpp glad.c -lGL -lglfw -ldl -std=c++11
clean:
rm sample2D
this is my contents of Makefile and my code for rendering the font
const char* fontfile = "Monaco.ttf";
GL3Font.font = new FTExtrudeFont(fontfile); // 3D extrude style rendering
if(GL3Font.font->Error())
{
cout << "Error: Could not load font `" << fontfile << "'" << endl;
glfwTerminate();
exit(EXIT_FAILURE);
}
// Create and compile our GLSL program from the font shaders
fontProgramID = LoadShaders( "fontrender.vert", "fontrender.frag" );
GLint fontVertexCoordAttrib, fontVertexNormalAttrib, fontVertexOffsetUniform;
fontVertexCoordAttrib = glGetAttribLocation(fontProgramID, "vertexPosition");
fontVertexNormalAttrib = glGetAttribLocation(fontProgramID, "vertexNormal");
fontVertexOffsetUniform = glGetUniformLocation(fontProgramID, "pen");
GL3Font.fontMatrixID = glGetUniformLocation(fontProgramID, "MVP");
GL3Font.fontColorID = glGetUniformLocation(fontProgramID, "fontColor");
GL3Font.font->ShaderLocations(fontVertexCoordAttrib, fontVertexNormalAttrib, fontVertexOffsetUniform);
GL3Font.font->FaceSize(1);
GL3Font.font->Depth(0);
GL3Font.font->Outset(0, 0);
GL3Font.font->CharMap(ft_encoding_unicode);