[Iwao@fedora C41]$ ll
合計 4
-rw-rw-r--. 1 Iwao Iwao 210 9月 6 14:22 c41.cpp
[Iwao@fedora C41]$ g++ c41.cpp
c41.cpp: 関数 ‘int main(int, char**)’ 内:
c41.cpp:10:4: エラー: ‘::glutCreatewindow’ has not been declared; did you mean ‘glutCreateWindow’?
10 | ::glutCreatewindow(argv[0]) ;
| ^~~~~~~~~~~~~~~~
| glutCreateWindow
c41.cpp:12:4: エラー: ‘::glutMainLooop’ has not been declared; did you mean ‘glutMainLoop’?
12 | ::glutMainLooop() ;
| ^~~~~~~~~~~~~
| glutMainLoop
[Iwao@fedora C41]$ g++ c41.cpp -lglut
c41.cpp: 関数 ‘int main(int, char**)’ 内:
c41.cpp:10:4: エラー: ‘::glutCreatewindow’ has not been declared; did you mean ‘glutCreateWindow’?
10 | ::glutCreatewindow(argv[0]) ;
| ^~~~~~~~~~~~~~~~
| glutCreateWindow
c41.cpp:12:4: エラー: ‘::glutMainLooop’ has not been declared; did you mean ‘glutMainLoop’?
12 | ::glutMainLooop() ;
| ^~~~~~~~~~~~~
| glutMainLoop
[Iwao@fedora C41]$ g++ c41.cpp
/usr/bin/ld: /tmp/ccBNDejL.o: in function `main':
c41.cpp:(.text+0x1e): undefined reference to `glutInit'
/usr/bin/ld: c41.cpp:(.text+0x2d): undefined reference to `glutCreateWindow'
/usr/bin/ld: c41.cpp:(.text+0x37): undefined reference to `glutDisplayFunc'
/usr/bin/ld: c41.cpp:(.text+0x3c): undefined reference to `glutMainLoop'
collect2: エラー: ld はステータス 1 で終了しました
[Iwao@fedora C41]$ g++ c41.cpp -lglut
[Iwao@fedora C41]$ ./a.out
4.1 空のウィンドウを開く
- 詳細
- カテゴリー: GLUT による OpenGL 入門
- 参照数: 929