我通过本教程了解如何安装 Mesa(OpenGL)。一切都按描述工作。但是,当我尝试将运行良好的构建命令放入生成文件时,它没有。
这是我的生成文件:
all:
gcc -lglut -IGL -IGLEW -IGLU main.c -o OpenGLExample
如果我输入make,我会得到:
gcc -lglut -IGL -IGLEW -IGLU main.c -o OpenGLExample
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glClearColor'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glClear'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glColor3f'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glOrtho'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glBegin'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glVertex2f'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glVertex2f'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glVertex2f'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glVertex2f'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glEnd'
/tmp/ccKVrQAu.o:main.c:function renderFunction: error: undefined reference to 'glFlush'
collect2: ld returned 1 exit status
make: *** [all] Error 1
我在教程中使用的是 Ubuntu 而不是 Mint。
我做错了什么?