LoginSignup
0
1

More than 5 years have passed since last update.

C++でのゲームプログラミングについて

Last updated at Posted at 2013-05-22

http://zahyou.6.ql.bz/cgame/dodge_code.htm
上記ページのプログラムを作成しています。
※ dodoge.rc のオブジェクトファイルは dodge_rc.o という名前にしています。

●開発環境
エディタ:EmEditor
コンパイラ:MinGW

オブジェクトファイルを作成して最後に
「g++ -Wall -O2 -mwindows -lwinmm dodge_rc.o dodge.o winmain.o -o dodge」
のコマンドでコンパイルすると

dodge.o:dodge.cpp:(.text+0x16): undefined reference to timeGetDevCaps@8'
dodge.o:dodge.cpp:(.text+0x24): undefined reference to
timeBeginPeriod@4'
dodge.o:dodge.cpp:(.text+0x2c): undefined reference to timeGetTime@0'
dodge.o:dodge.cpp:(.text+0xc2): undefined reference to
mciSendStringA@16'
dodge.o:dodge.cpp:(.text+0xe9): undefined reference to mciSendStringA@16'
dodge.o:dodge.cpp:(.text+0x343): undefined reference to
timeGetTime@0'
dodge.o:dodge.cpp:(.text+0x394): undefined reference to timeGetTime@0'
dodge.o:dodge.cpp:(.text+0x3f3): undefined reference to
timeEndPeriod@4'
dodge.o:dodge.cpp:(.text+0x44a): undefined reference to mciSendStringA@16'
dodge.o:dodge.cpp:(.text+0x469): undefined reference to
PlaySoundA@12'
dodge.o:dodge.cpp:(.text+0x570): undefined reference to mciSendStringA@16'
dodge.o:dodge.cpp:(.text+0x5b9): undefined reference to
mciSendStringA@16'
dodge.o:dodge.cpp:(.text+0x120a): undefined reference to PlaySoundA@12'
dodge.o:dodge.cpp:(.text+0x1231): undefined reference to
mciSendStringA@16
dodge.o:dodge.cpp:(.text+0x15b3): undefined reference to PlaySoundA@12'
winmain.o:winmain.cpp:(.text+0x214): undefined reference to
timeGetTime@0'
winmain.o:winmain.cpp:(.text+0x284): undefined reference to timeGetTime@0'
winmain.o:winmain.cpp:(.text+0x2c9): undefined reference to
timeGetTime@0'
winmain.o:winmain.cpp:(.text+0x2df): undefined reference to `timeGetTime@0'
collect2: ld returned 1 exit status

と表示されコンパイルできません。

ヘッダファイルに「mmsystem.h」をインクルードしているのが原因だと考え、「-lwinmm」をオプションに加えたのですが、やはりコンパイルできません。
コンパイルできない原因は何が原因だと考えられるか教えてください。
よろしくお願いします。

0
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1