Note that there are some explanatory texts on larger screens.

plurals
  1. POopengl on ubuntu linux - Linker error: undefined references
    primarykey
    data
    text
    <p>I just want to start in openGL programming, so I installed freeglut3 from the repositories of ubuntu and I have all mesa packages installed, as well as build-essentials.</p> <p>Later, I copied one simple example of <a href="http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction#Initialization" rel="nofollow noreferrer">openGL wiki</a> <br/> In first, I tried to compile it with: <code>gcc triangle.c -o triangle.o</code>; <br/>but, later, I read here: <a href="https://stackoverflow.com/questions/17766420/linker-error-undefined-reference-to-symbol-glortho">Linker error : undefined reference to symbol &#39;glOrtho&#39;</a> that i have to linked the libraries with -l.<br/> So, I tried with <code>gcc triangle.c -lglut -lGL -Wall -o triangle.o</code></p> <p>Both return the same error:</p> <pre><code>/tmp/ccKLT4ac.o: In function `main': triangle.c:(.text+0x2b): undefined reference to `glutInit' triangle.c:(.text+0x37): undefined reference to `glutInitDisplayMode' triangle.c:(.text+0x4b): undefined reference to `glutInitWindowSize' triangle.c:(.text+0x57): undefined reference to `glutCreateWindow' triangle.c:(.text+0x5c): undefined reference to `glewInit' triangle.c:(.text+0x73): undefined reference to `glewGetErrorString' triangle.c:(.text+0xaa): undefined reference to `glutDisplayFunc' triangle.c:(.text+0xaf): undefined reference to `glutMainLoop' collect2: error: ld returned 1 exit status </code></pre> <p>I've tried to include gl.h &amp; glu.h libraries, try with a lot of different example programs in cpp,... and a lot of combinations. All return similar errors.</p> <p>ah, in /usr/include I have all the libraries:</p> <pre><code>akronix@ASJ-Netbook:~$ ls /usr/include/GL freeglut_ext.h glext.h glu_mangle.h glx.h glxproto.h freeglut.h gl.h glut.h glxint.h glxtokens.h freeglut_std.h gl_mangle.h glxew.h glx_mangle.h internal glew.h glu.h glxext.h glxmd.h wglew.h </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload