游戏开发论坛

 找回密码
 立即注册
搜索
查看: 6961|回复: 4

求助。编译链接《DirectX角色扮演游戏编程》的代码出错,

[复制链接]

3

主题

11

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2008-10-22 11:41:00 | 显示全部楼层 |阅读模式
RT,求救。

Windows XP SP3; VC++6.0;DirectX 9.0 SDK (October 2004)
建立的工程为WIN32APPLICATION

已经把lib和include文件夹添加进去了,出现的错误为链接错误。我想把源码也贴上来,不过太多了。。。

错误如下:
Linking...
Core_Graphics.obj : error LNK2001: unresolved external symbol _Direct3DCreate9@4
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateSprite@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixTranslation@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationYawPitchRoll@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixScaling@16
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixMultiply@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixTranspose@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationZ@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationY@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationX@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateFontIndirect@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _DirectXFileCreate@4
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileData
Core_Graphics.obj : error LNK2001: unresolved external symbol _IID_IDirectXFileDataReference
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationKey
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimation
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationSet
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileA@12
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXComputeBoundingSphere@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXComputeBoundingBox@20
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXLoadSkinMeshFromXof@36
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMMesh
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrameTransformMatrix
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMFrame
Core_Graphics.obj : error LNK2001: unresolved external symbol _TID_D3DRMAnimationOptions
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXCreateTextureFromFileExA@56
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXGetFVFVertexSize@4
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXMatrixRotationQuaternion@8
Core_Graphics.obj : error LNK2001: unresolved external symbol _D3DXQuaternionSlerp@16
Core_Input.obj : error LNK2001: unresolved external symbol _DirectInput8Create@20
Core_Input.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
Core_Input.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
Core_Input.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
Core_Network.obj : error LNK2001: unresolved external symbol _CLSID_DP8SP_TCPIP
Core_Network.obj : error LNK2001: unresolved external symbol _CLSID_DirectPlay8Client
Core_Network.obj : error LNK2001: unresolved external symbol _IID_IDirectPlay8Client
Core_Network.obj : error LNK2001: unresolved external symbol _CLSID_DirectPlay8Server
Core_Network.obj : error LNK2001: unresolved external symbol _IID_IDirectPlay8Server
Core_Network.obj : error LNK2001: unresolved external symbol _CLSID_DirectPlay8Address
Core_Network.obj : error LNK2001: unresolved external symbol _IID_IDirectPlay8Address
Core_Network.obj : error LNK2001: unresolved external symbol _inet_ntoa@4
Core_Network.obj : error LNK2001: unresolved external symbol _WSACleanup@0
Core_Network.obj : error LNK2001: unresolved external symbol _gethostbyname@4
Core_Network.obj : error LNK2001: unresolved external symbol _gethostname@8
Core_Network.obj : error LNK2001: unresolved external symbol _WSAStartup@8
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_DirectMusicAllTypes
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_PerfMasterVolume
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicPerformance
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicPerformance8
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicLoader
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicLoader8
Core_Sound.obj : error LNK2001: unresolved external symbol _DirectSoundCreate8@12
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectSoundNotify
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectSoundBuffer8
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_StandardMIDIFile
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicSegment8
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicSegment
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_ConnectToDLSCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_PerfMasterTempo
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IDirectMusicCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _GUID_DefaultGMCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_DirectMusicCollection
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IMediaEvent
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IMediaControl
Core_Sound.obj : error LNK2001: unresolved external symbol _CLSID_FilterGraph
Core_Sound.obj : error LNK2001: unresolved external symbol _IID_IGraphBuilder
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/game1_081021.exe : fatal error LNK1120: 71 unresolved externals
Error executing link.exe.   

3

主题

11

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2008-10-22 12:12:00 | 显示全部楼层

Re:求助。编译链接《DirectX角色扮演游戏编程》的代码出错,

连接错误解决了。不过现在还是有问题,就是类似于C2501: 'DWORD_PTR' : missing storage-class or type specifiers

继续求助:
Compiling...
Core_Graphics.cpp
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Core_Input.cpp
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Core_Network.cpp
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Core_Sound.cpp
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Core_System.cpp
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2146: syntax error : missing ';' before identifier 'dwReserved1'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(305) : error C2501: 'dwReserved1' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2146: syntax error : missing ';' before identifier 'dwReserved2'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\dsound.h(306) : error C2501: 'dwReserved2' : missing storage-class or type specifiers
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
e:\program files\microsoft directx 9.0 sdk (october 2004)\include\strmif.h(1024) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

0

主题

769

帖子

1052

积分

金牌会员

Rank: 6Rank: 6

积分
1052
发表于 2008-10-22 14:43:00 | 显示全部楼层

Re:求助。编译链接《DirectX角色扮演游戏编程》的代码出错,

人家是DX 9.0B的开发包写的代码,你用新的SDK肯定出错啦,换回DX9.0B或给代码动手术吧

0

主题

2

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2008-10-23 09:00:00 | 显示全部楼层

Re:求助。编译链接《DirectX角色扮演游戏编程》的代码出错,

把v6.0换vc2005吧

3

主题

11

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2008-10-23 09:07:00 | 显示全部楼层

Re:求助。编译链接《DirectX角色扮演游戏编程》的代码出错,

结贴。
谢谢楼上,重新下了2004的directx,问题已经解决了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-21 02:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表