Cygwin + MinGW + GCC 相談室 Part 3at TECH
Cygwin + MinGW + GCC 相談室 Part 3 - 暇つぶし2ch39:デフォルトの名無しさん
07/05/17 10:27:09
WindowsXPにMingw+MSYSでプログラミングしています。
Mesa-6.5.3とglut-3.7.6をmakeし、/mingw/include /mingw/libに
ヘッダファイルとライブラリをコピーし次のサンプルプログラム
をコンパイルしたところlinkerエラーになってしまいます。

#include <GL/glut.h>
void display(void) { }
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutCreateWindow(argv[0]);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

$ gcc -o test.exe test.c -lglut32 -lopengl32 -L/mingw/lib
C:/(hoge)/Temp/ccG2baaa.o:test.c:(.text+0x1c): undefined reference to `__glutInitWithExit'
C:/(hoge)/Temp/ccG2baaa.o:test.c:(.text+0x37): undefined reference to `__glutCreateWindowWithExit'
C:/(hoge)/Temp/ccG2baaa.o:test.c:(.text+0x52): undefined reference to `__glutCreateMenuWithExit'
C:/(hoge)/Temp/ccG2baaa.o:test.c:(.text+0xae): undefined reference to `glutDisplayFunc'
C:/(hoge)/Temp/ccG2baaa.o:test.c:(.text+0xb3): undefined reference to `glutMainLoop'
collect2: ld returned 1 exit status

リンカーがlibglut32.aを見つけられてないような気がしるのですが、
ライブラリをコピーするだけではだめなのでしょうか。




次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch