OpenGL generator generator undefined link to gl :: BindBuffer etc. (OpenGL Features)

I have a problem when using the OpenGL Loader Generator , which when I try to compile my code does not work. It throws an error referring to an undefined reference to any opengl function that I use, for example gl :: BindBuffer, gl :: GenBuffers, etc. I am using pointer_cpp / func_cpp style.

My simple code that I use is

#include "gl_core_3_3.hpp" #include <GL/glfw.h> int main(int argc, char *argv[]) { glfwInit(); glfwOpenWindow(1024, 768, 0, 0, 0, 0, 0, 0, GLFW_WINDOW); gl::exts::LoadTest didLoad = gl::sys::LoadFunctions(); if(!didLoad) { glfwTerminate(); return 1; } return 0; } 

When I compile this, it says an undefined link to gl :: sys :: LoadFunctions. The command I use to compile is

 g++ main.cpp -lglfw -lGL -lGLU 

I am on Arch Linux and use Vim with clang as my IDE.

0
source share
1 answer
 g++ main.cpp -lglfw -lGL -lGLU 

I do not see where you include the generated source file. This is not a header-only download system. It does not generate a library, but generates the source code that must be compiled.

+1
source

All Articles