ld没有在Linux上链接OpenGL
发布时间:2020-05-23 15:38:12 所属栏目:Linux 来源:互联网
导读:gcc -lGL -lGLU -lglut light.c /tmp/ccfuthSi.o: In function `init:light.c:(.text+0x72): undefined reference to `glClearColorlight.c:(.text+0x7e): undefined reference to `glShadeModellight.c:(.te
gcc -lGL -lGLU -lglut light.c /tmp/ccfuthSi.o: In function `init': light.c:(.text+0x72): undefined reference to `glClearColor' light.c:(.text+0x7e): undefined reference to `glShadeModel' light.c:(.text+0x99): undefined reference to `glMaterialfv' light.c:(.text+0xb4): undefined reference to `glMaterialfv' light.c:(.text+0xcf): undefined reference to `glLightfv' light.c:(.text+0xdb): undefined reference to `glEnable' light.c:(.text+0xe7): undefined reference to `glEnable' light.c:(.text+0xf3): undefined reference to `glEnable' /tmp/ccfuthSi.o: In function `display': light.c:(.text+0x107): undefined reference to `glClear' light.c:(.text+0x121): undefined reference to `glutSolidSphere' light.c:(.text+0x126): undefined reference to `glFlush' /tmp/ccfuthSi.o: In function `reshape': light.c:(.text+0x150): undefined reference to `glViewport' light.c:(.text+0x15c): undefined reference to `glMatrixMode' light.c:(.text+0x161): undefined reference to `glLoadIdentity' light.c:(.text+0x1bf): undefined reference to `glOrtho' light.c:(.text+0x217): undefined reference to `glOrtho' light.c:(.text+0x223): undefined reference to `glMatrixMode' light.c:(.text+0x228): undefined reference to `glLoadIdentity' /tmp/ccfuthSi.o: In function `main': light.c:(.text+0x268): undefined reference to `glutInit' light.c:(.text+0x274): undefined reference to `glutInitDisplayMode' light.c:(.text+0x288): undefined reference to `glutInitWindowSize' light.c:(.text+0x29c): undefined reference to `glutInitWindowPosition' light.c:(.text+0x2a9): undefined reference to `glutCreateWindow' light.c:(.text+0x2ba): undefined reference to `glutDisplayFunc' light.c:(.text+0x2c6): undefined reference to `glutReshapeFunc' light.c:(.text+0x2d2): undefined reference to `glutKeyboardFunc' light.c:(.text+0x2d7): undefined reference to `glutMainLoop' 如您所见,我将所需的参数传递给gcc.为什么它不起作用? Linux Mint 12. 解决方法它确实是一个常见问题解答(这里已多次询问和回答).参数顺序在链接时很重要.图书馆应该是最后的(并且顺利).你应该跑gcc -Wall -g light.c -lGL -lGLU -lglut -o light (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – 如何在机器之间同步巨大的稀疏文件(VM磁盘映像)?
- linux – 升级到Ubuntu 15.04后,MongoDB服务无法运行
- linux – Shell:如果a小于b,“a -lt b”是不是真的?
- linux – 我应该关注SMART Hardware_ECC_Recovered值高吗?
- linux – ant Permission Denied问题
- linux – 如何获取上次使用的./configure参数?
- linux – 如何阻止ICMP攻击?
- 存储 – LVM和LUN之间的区别
- backup – 等同于文件系统IO的“nice”?
- linux – 将当前日期/时间和文件数写入文件
