当前位置: 技术问答>linux和unix
关于Cygwin的openGL函数库调用的问题
来源: 互联网 发布时间:2016-08-19
本文导语: 最近本人在使用cygwin。在全部安装所有函数以后,写了一段OPENGL程序,但是编译的时候发现所有的opengl函数豆不可用。我的opengl四个文件gl.h glu.h glex.h glut.h全部在文件夹/usr/include/w32api/GL里,不知道哪里链接出现的...
最近本人在使用cygwin。在全部安装所有函数以后,写了一段OPENGL程序,但是编译的时候发现所有的opengl函数豆不可用。我的opengl四个文件gl.h glu.h glex.h glut.h全部在文件夹/usr/include/w32api/GL里,不知道哪里链接出现的错误导致不可编译或者是其他问题,请哪位兄弟知道回答下,感激不尽。
|
我也遇到这个问题,我来贴,我的cygwin是完全安装在d:/Cygwin下面 代码在d:/OpenGL里
$ gcc hello.c -o hello
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xe): undefine
d reference to `_glClear'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x2d): undefin
ed reference to `_glColor3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x39): undefin
ed reference to `_glBegin'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x58): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x77): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x96): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xb5): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xba): undefin
ed reference to `_glEnd'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xbf): undefin
ed reference to `_glFlush'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xef): undefin
ed reference to `_glClearColor'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xfb): undefin
ed reference to `_glMatrixMode'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x100): undefi
ned reference to `_glLoadIdentity'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x12c): undefi
ned reference to `_glOrtho'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x16a): undefi
ned reference to `_glutInit'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x176): undefi
ned reference to `_glutInitDisplayMode'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x18a): undefi
ned reference to `_glutInitWindowSize'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x19e): undefi
$
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1aa): undefi
ned reference to `_glutCreateWindow'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1bb): undefi
ned reference to `_glutDisplayFunc'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1c0): undefi
ned reference to `_glutMainLoop'
collect2: ld returned 1 exit status
$ gcc hello.c -o hello
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xe): undefine
d reference to `_glClear'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x2d): undefin
ed reference to `_glColor3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x39): undefin
ed reference to `_glBegin'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x58): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x77): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x96): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xb5): undefin
ed reference to `_glVertex3f'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xba): undefin
ed reference to `_glEnd'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xbf): undefin
ed reference to `_glFlush'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xef): undefin
ed reference to `_glClearColor'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0xfb): undefin
ed reference to `_glMatrixMode'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x100): undefi
ned reference to `_glLoadIdentity'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x12c): undefi
ned reference to `_glOrtho'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x16a): undefi
ned reference to `_glutInit'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x176): undefi
ned reference to `_glutInitDisplayMode'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x18a): undefi
ned reference to `_glutInitWindowSize'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x19e): undefi
$
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1aa): undefi
ned reference to `_glutCreateWindow'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1bb): undefi
ned reference to `_glutDisplayFunc'
/cygdrive/c/DOCUME~1/user/LOCALS~1/Temp/ccH2N85v.o:hello.c:(.text+0x1c0): undefi
ned reference to `_glutMainLoop'
collect2: ld returned 1 exit status
|
中国叫兽的某些话,可以当废气处理,呵呵
你学的是OpenGL,而不是一个去配一个根本没人用的环境!