No.16916![]() |
openGLを使おうとしてコンパイルできません 投稿者---Aki(2004/09/27 00:51:36) |
||
windowsXP、コンパイラはBorlandを使っています。 openGLを使おうと思ってGLUTをインストールしました。 glut32.dll は %WinDir%\System32 glut32.lib は <Windows Platform SDKインストール先>\Lib glut.h は <Windows Platform SDKインストール先>\include\gl そして、簡単なウィンドウ表示プログラムをコンパイルしたところ、 glut32.libが壊れている(?)、といったエラーが出て コンパイルできません。 Error: 'C:\BORLAND\BCC55\LIB\GLUT32.LIB' contains invalid OMF record, type 0x21 (possibly COFF) このファイルはいくつかのページでも紹介されていた http://www.xmission.com/~nate/glut.html で落としたものなのですが、 やはりファイルが壊れているのでしょうか。 それとも、インストールの段階で、ファイル移動以外に まだ何かしなければならないことがあって、そのせいなのでしょうか。 ちなみに、ウィンドウを表示するプログラムというのは #include <GL/glut.h> void display(void) { } int main(int argc, char *argv[]) { glutInit(&argc, argv); glutCreateWindow(argv[0]); glutDisplayFunc(display); glutMainLoop(); return 0; } です。 分かる方いらっしゃったら教えてください。 よろしくお願いします。 |
No.16917![]() |
Re:openGLを使おうとしてコンパイルできません 投稿者---monkey(2004/09/27 01:34:51) |
||
BCCの場合、BCCに附属するimplib.exeを使って、ダウンロードしたglut32.dllからglut32.libを作成する必要があります。 【README-win32.txtより引用】 BORLAND NOTES: From what I understand, Borland supplies a utility that converts Microsoft Visual C++ .libs into Borland compatible files. Therefore, the best method for Borland users is probably to get the precompiled versions of the library and convert the library. To create an import library for Borland from the DLLs, use the following command (from a command prompt): IMPLIB glut32.lib glut32.dll If IMPLIB crashes when called this way, try IMPLIB glut32.lib glut32.def using the glut32.def file in this distribution. |
No.16919![]() |
Re:openGLを使おうとしてコンパイルできません 投稿者---Aki(2004/09/27 08:28:25) |
||
monkeyさん、ありがとうございます。 このコマンドで作ったglut32.libならエラーになりませんでした。 しかし、コンパイルで新たなエラーが発生して、 glu32.libが開けないとかopengl32.libが開けないなどといわれました。 Borlandの始めの圧縮ファイルを解凍した時点では、 これらのファイルはLib/PSDKの中にあり、 PSDKから出してLibに入れてやらないとだめなようです。 結局コンパイルはうまくいきました。 monkeyさん、本当に助かりました。 |