利用vc++6.0进行DirectX3D音乐编程的注意点

来源:互联网 发布:能看被禁动漫的软件 编辑:程序博客网 时间:2024/04/30 01:33

按照《DirectX游戏开发终极指南》中示例进行音乐编程的时候,编译不犯错,链接的时候遇到如下错误

--------------------Configuration: MainProgram - Win32 Debug--------------------
Linking...
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicAudioPath already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicContainer already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicScript already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicPatternTrack already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicStyle8 already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicSegmentState8 already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicSegment8 already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicPerformance8 already defined in StrandedEngine.lib(DirectMusic.obj)
dxguid.lib(dxguid.obj) : error LNK2005: _IID_IDirectMusicLoader8 already defined in StrandedEngine.lib(DirectMusic.obj)

.............

dxguid.lib(dxguid.obj) : error LNK2005: _CLSID_DirectSound already defined in StrandedEngine.lib(DirectMusic.obj)
Debug/MainProgram.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.


MainProgram.exe - 1 error(s), 0 warning(s)


上网查找资料发现是因为程序中添加了这句话

#define INITGUID

把这句话去掉就OK了,至于为什么我也不太理解,可能是因为书上用的编辑器不是vc++6.0的缘故,不同编辑器之间语法可能有一点不同吧

0 0
原创粉丝点击