So recently I'm trying to take up some graphics programming with openGL. After some help from Tari I managed to get the gflw libraries and header files included, and a simple window working. There was a problem however, which the gflw website neglects. The "glClear(GL_COLOR_BUFFER_BIT);" is supposedly a facet of the glad header files, and not included in the gflw libs. Well I went and included the glad header files into my program, and it seems to have worked. However, neither the "glClear(GL_COLOR_BUFFER_BIT);" function or the "gladLoadGL()" function are recognized by the compiler. This is a massive problem because- at least with my understanding of it- without the glad functions you can't use extensions and thousands of useful functions. For the life of me I have no clue why this is happening! But honestly that's not saying much XD.
Here's the link to the github repository. any help is appreciated!

I think the main problem is that the gladLoadGL() function is not working. Here is a screenshot of the error scrn.

EDIT: upon further inspection it seems that the glad loader library is not working correctly, which is confusing because I'm getting no errors concerning the library. The only errors occur when I try and invoke glad's functions.

You're not even getting to the point of running any functions from the glad library- your linker is complaining because you're not linking against glad, so it's telling you that it doesn't know where to find the implementations of these functions (LNK2019: unresolved external symbol) because you haven't told it to link a library or object file that provides them.

I'm guessing you failed to add the glad.c file that glad generated as a loader to your CMakeLists to build that file- add a reference to that file in your add_executable statement:
add_executable(OpenGLTest src/main.cpp src/glad.c)

You may want to do some reading to better understand how the compiler and linker fit together and better interpret the errors you get.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum