• Forum
  • Lounge
  • Anyone know anything about OpenGl that c

 
Anyone know anything about OpenGl that can give a guy some insight

Today is not my day. (or the last two for that matter)

Moving on. I recently hit a roadblock with running tutorial files created by premake that I think was caused by incorrect setup on my part. I decided to start from a clean slate deleting and redownloading everything and believe I have done everything correctly as of yet as I have a much better understanding of the whole process! However now I'm getting these beautiful 'undefined reference to ____ ' errors for almost every line of code. Completely at a loss after researching for too long. Typically I can figure stuff out on computer fairly well but setting up these tutorials has been an ongoing nightmare for me and it's killing my motivation :(

My process went as follows: download premake, download free glsdk, download tutorial files, create and compile library files, create build files for tutorials, try to run those projects in codeblocks, and get the errors.

Anywho, this is the build log:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

mingw32-g++.exe -L..\glsdk\glload\lib -L..\glsdk\glimg\lib -L..\glsdk\glutil\lib -L..\glsdk\glmesh\lib -L..\glsdk\freeglut\lib -L..\framework\lib -o "Tut 01 MainD.exe" obj\Debug\tut1.o   -lframeworkD -lglloadD -lglimgD -lglutilD -lglmeshD -lfreeglutD -lglu32 -lopengl32 -lgdi32 -lwinmm -luser32
obj\Debug\tut1.o: In function `Z12CreateShaderjRKSs':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:16: undefined reference to `__gleCreateShader'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:18: undefined reference to `__gleShaderSource'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:20: undefined reference to `__gleCompileShader'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:23: undefined reference to `__gleGetShaderiv'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:27: undefined reference to `__gleGetShaderiv'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:30: undefined reference to `__gleGetShaderInfoLog'
obj\Debug\tut1.o: In function `Z13CreateProgramRKSt6vectorIjSaIjEE':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:49: undefined reference to `__gleCreateProgram'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:52: undefined reference to `__gleAttachShader'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:54: undefined reference to `__gleLinkProgram'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:57: undefined reference to `__gleGetProgramiv'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:61: undefined reference to `__gleGetProgramiv'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:64: undefined reference to `__gleGetProgramInfoLog'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:70: undefined reference to `__gleDetachShader'
obj\Debug\tut1.o: In function `Z17InitializeProgramv':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:104: undefined reference to `__gleDeleteShader'
obj\Debug\tut1.o: In function `Z22InitializeVertexBufferv':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:119: undefined reference to `__gleGenBuffers'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:121: undefined reference to `__gleBindBuffer'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:122: undefined reference to `__gleBufferData'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:123: undefined reference to `__gleBindBuffer'
obj\Debug\tut1.o: In function `Z4initv':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:132: undefined reference to `__gleGenVertexArrays'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:133: undefined reference to `__gleBindVertexArray'
obj\Debug\tut1.o: In function `Z7displayv':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:141: undefined reference to `__gleClearColor'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:142: undefined reference to `__gleClear'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:144: undefined reference to `__gleUseProgram'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:146: undefined reference to `__gleBindBuffer'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:147: undefined reference to `__gleEnableVertexAttribArray'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:148: undefined reference to `__gleVertexAttribPointer'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:150: undefined reference to `__gleDrawArrays'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:152: undefined reference to `__gleDisableVertexAttribArray'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:153: undefined reference to `__gleUseProgram'
obj\Debug\tut1.o: In function `Z7reshapeii':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/Tut 01 Hello Triangle/tut1.cpp:162: undefined reference to `__gleViewport'
..\framework\lib/libframeworkD.a(framework.o): In function `ZN9Framework10LoadShaderEjRKSs':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:37: undefined reference to `glutil::CompileShader(unsigned int, std::string const&)'
..\framework\lib/libframeworkD.a(framework.o): In function `ZN9Framework13CreateProgramERKSt6vectorIjSaIjEE':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:50: undefined reference to `glutil::LinkProgram(std::vector<unsigned int, std::allocator<unsigned int> > const&, bool)'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:51: undefined reference to `__gleDeleteShader'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:56: undefined reference to `__gleDeleteShader'
..\framework\lib/libframeworkD.a(framework.o): In function `main':
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:163: undefined reference to `__gleEnable'
C:/Users/Mcodes/Desktop/Attempt_to_Tut/GlTutorials/framework/framework.cpp:164: undefined reference to `glDebugMessageCallbackARB'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
36 error(s), 0 warning(s) (0 minute(s), 1 second(s))


Like these tutorial files are supposed to actually run, correct???

It's especially frustrating as I was taking screenshots at every single step and saving text logs to try and make a more detailed tutorial (inspired by my and many others I've seen on the internets' troubles with the official descriptions of how to set up the tutorials being quite ambiguous for those not especially computer savvi at the moment).
But now I've reached the final step and I'm stuck myself haha... Good news is I have a very detailed rundown of my entire process if it helps. What would be the preferred file type if I were to upload a rundown including photos and text?

Thanks immensely in advance
Two possible causes:
a) Your OpenGL library is too old which doesn't support shaders (OpenGL 2.0 and later)
b) What is 'gle'? shouldn't all functions start with 'gl'?
There's a few issues here...

OpenGL shouldn't be used directly in most cases. So libraries will load them into exported function pointers that you have to initialize first. They then make defines that make you think the normal OpenGL functions are actually the function pointers that library created. It's for a standardized effect.

You're most likely not linking to whatever library that is. That and glDebugMessageCallbackARB is probably not defined in those headers.
Ah, yes. I am very familiar with this tutorial. If I recall, I never really did manage to get the whole thing to work- I think I had to drop, either entirely or parts of, tutorial 16, 17, and 18. I believe you have to re-name the openGL SDK folder to match whatever the path it wants, because it is incorrect.
Topic archived. No new replies allowed.