首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

链接有关问题

2012-02-11 
链接问题源代码里面的包含代码:#include t3dlib1.h // game library includes#include t3dlib2.h#incl

链接问题
源代码里面的包含代码:
#include "t3dlib1.h" // game library includes
#include "t3dlib2.h"
#include "t3dlib3.h"
 
但是链接的时候出现了--------------------Configuration: TankWar - Win32 Debug--------------------
Linking...
TankWar.obj : error LNK2001: unresolved external symbol "int window_client_y0" (?window_client_y0@@3HA)
TankWar.obj : error LNK2001: unresolved external symbol "int window_client_x0" (?window_client_x0@@3HA)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned long __cdecl Start_Clock(void)" (?Start_Clock@@YAKXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Init(void)" (?DMusic_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Init(void)" (?DSound_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Init_Keyboard(void)" (?DInput_Init_Keyboard@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Init(void)" (?DInput_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Init(int,int,int,int)" (?DDraw_Init@@YAHHHHH@Z)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Shutdown(void)" (?DDraw_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "void __cdecl DInput_Shutdown(void)" (?DInput_Shutdown@@YAXXZ)
TankWar.obj : error LNK2001: unresolved external symbol "void __cdecl DInput_Release_Keyboard(void)" (?DInput_Release_Keyboard@@YAXXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Shutdown(void)" (?DMusic_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Delete_All_MIDI(void)" (?DMusic_Delete_All_MIDI@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Shutdown(void)" (?DSound_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Delete_All_Sounds(void)" (?DSound_Delete_All_Sounds@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Stop_All_Sounds(void)" (?DSound_Stop_All_Sounds@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned char * keyboard_state" (?keyboard_state@@3PAEA)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned long __cdecl Wait_Clock(unsigned long)" (?Wait_Clock@@YAKK@Z)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Flip(void)" (?DDraw_Flip@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Read_Keyboard(void)" (?DInput_Read_Keyboard@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Fill_Surface(struct IDirectDrawSurface7 *,unsigned short,struct tagRECT *)" (?DDraw_Fill_Surface@@YAHPAUIDirectDrawSurface7@@GPAUtagRECT@@@Z)
TankWar.obj : error LNK2001: unresolved external symbol "struct IDirectDrawSurface7 * lpddsback" (?lpddsback@@3PAUIDirectDrawSurface7@@A)
Debug/TankWar.exe : fatal error LNK1120: 22 unresolved externals
执行 link.exe 时出错.

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


相关的t3dlib1.h t3dlib2.h t3dlib3.h及.cpp文件都再工程目录下面,这是怎么回事啊!!!

[解决办法]
在工程目录下不管用,要在工程里面才有用
[解决办法]
需要在project->setting ....里面设置路径
[解决办法]
少相关LIB 文件,把LIB文件加入工程中
[解决办法]

探讨
源代码里面的包含代码:
#include "t3dlib1.h" // game library includes
#include "t3dlib2.h"
#include "t3dlib3.h"

但是链接的时候出现了--------------------Configuration: TankWar - Win32 Debug--------------------
Linking...
TankWar.obj : error LNK2001: unresolved external symbol "int window_client_y0" (?window_client_y0@@3HA)
TankWar.obj : error LNK2001: unresolved external symbol "int window_client_x0" (?window_client_x0@@3HA)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned long __cdecl Start_Clock(void)" (?Start_Clock@@YAKXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Init(void)" (?DMusic_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Init(void)" (?DSound_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Init_Keyboard(void)" (?DInput_Init_Keyboard@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Init(void)" (?DInput_Init@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Init(int,int,int,int)" (?DDraw_Init@@YAHHHHH@Z)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Shutdown(void)" (?DDraw_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "void __cdecl DInput_Shutdown(void)" (?DInput_Shutdown@@YAXXZ)
TankWar.obj : error LNK2001: unresolved external symbol "void __cdecl DInput_Release_Keyboard(void)" (?DInput_Release_Keyboard@@YAXXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Shutdown(void)" (?DMusic_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DMusic_Delete_All_MIDI(void)" (?DMusic_Delete_All_MIDI@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Shutdown(void)" (?DSound_Shutdown@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Delete_All_Sounds(void)" (?DSound_Delete_All_Sounds@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DSound_Stop_All_Sounds(void)" (?DSound_Stop_All_Sounds@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned char * keyboard_state" (?keyboard_state@@3PAEA)
TankWar.obj : error LNK2001: unresolved external symbol "unsigned long __cdecl Wait_Clock(unsigned long)" (?Wait_Clock@@YAKK@Z)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Flip(void)" (?DDraw_Flip@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DInput_Read_Keyboard(void)" (?DInput_Read_Keyboard@@YAHXZ)
TankWar.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Fill_Surface(struct IDirectDrawSurface7 *,unsigned short,struct tagRECT *)" (?DDraw_Fill_Surface@@YAHPAUIDirectDrawSurface7@@GPAUtagRECT@@@Z)
TankWar.obj : error LNK2001: unresolved external symbol "struct IDirectDrawSurface7 * lpddsback" (?lpddsback@@3PAUIDirectDrawSurface7@@A)
Debug/TankWar.exe : fatal error LNK1120: 22 unresolved externals
执行 link.exe 时出错.

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


相关的t3dlib1.h  t3dlib2.h  t3dlib3.h及.cpp文件都再工程目录下面,这是怎么回事啊!!!

热点排行