ホーム » 2019 » 10月 » 23

日別アーカイブ: 2019/10/23

2019年10月
 12345
6789101112
13141516171819
20212223242526
2728293031  

カテゴリー

アーカイブ

ブログ統計情報

  • 79,632 アクセス



VC Linux で GLUT

GLUT を使用したコード
ビルドするとリンクでのエラーとなってしまう.

1>------ ビルド開始: プロジェクト: T_GL2, 構成: Debug x64 ------
1>ソースを検証します
1>リモートでソースを 'fedora' にコピーします
1>アーキテクチャを検証します
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Application Type\Linux\1.0\Linux.targets(184,5): warning : 配置で使用されるリモート システムに互換性のないプラットフォーム アーキテクチャ ('x64'、'ARM') があります。
1>アーキテクチャを検証します
1>リモート ビルドを開始しています
1>ソースをコンパイルします:
1>オブジェクトをリンクしています
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/obj/x64/Debug/main.o: in function `idle()':
1>D:\Document\VS\VS\2019\T_Linux\T_GL2\main.cpp(51): error : undefined reference to `glutPostRedisplay'
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/obj/x64/Debug/main.o: in function `display()':
1>D:\Document\VS\VS\2019\T_Linux\T_GL2\main.cpp(56): error : undefined reference to `glClear'
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/main.cpp:63: undefined reference to `glMatrixMode'
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/main.cpp:64: undefined reference to `glLoadIdentity'
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/main.cpp:65: undefined reference to `gluLookAt'
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/main.cpp:67: undefined reference to `glColor3d'
...
1>/usr/bin/ld : error : /home/Iwao/projects/T_GL2/main.cpp:165: undefined reference to `glutMainLoop'
1>collect2 : error : エラー: ld はステータス 1 で終了しました
1>プロジェクト "T_GL2.vcxproj" のビルドが終了しました -- 失敗。
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

コマンドでの -l オプションにあたる指定が足りないため.
「リンカー」-「コマンドライン」-「追加のオプション」に以下を追加.
-lglut -lGL -lGLU
-l オプション
GLUT を使用した .out

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.