原创:http://blog.csdn.net/u013383042/article/details/50345311

  • 出错状况
lh@ubuntu:~$ gcc -lglut -o example example.c 
/tmp/ccT7NQY2.o: In function `init':
example.c:(.text+0x139): undefined reference to `gluLookAt'
  • 解决办法
    输入命令:sudo apt-get install freeglut3-dev

  • 编译运行

//注意:这是一定要加上-lGLU库
:~$ gcc -lglut -lGLU -o example example.c 
lh@ubuntu:~$ ./example

至此,程序中包含对gluLookAt()函数的调用也可以成功运行了!

Logo

更多推荐