C ++未解析的外部符号LNK2019和LNK2001

时间:2015-01-09 05:47:25

标签: c++

我正在实现找到here的影子系统,我在clientshadowmgr.cpp中进行了所有更改,并将worldlight.cpp / .h添加到游戏/客户端。

当我构建解决方案时,我遇到了这些错误:

1>clientshadowmgr.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CWorldLights::GetBrightestLightSource(class Vector const &,class Vector &,class Vector &)" (?GetBrightestLightSource@CWorldLights@@QAE_NABVVector@@AAV2@1@Z) referenced in function "private: void __thiscall CClientShadowMgr::UpdateShadowDirectionFromLocalLightSource(unsigned short)" (?UpdateShadowDirectionFromLocalLightSource@CClientShadowMgr@@AAEXG@Z)
1>clientshadowmgr.obj : error LNK2001: unresolved external symbol "class CWorldLights * g_pWorldLights" (?g_pWorldLights@@3PAVCWorldLights@@A)
1>.\Release_mod_hl2\\client.dll : fatal error LNK1120: 2 unresolved externals

在worldlight.h中:

//-----------------------------------------------------------------------------
// Singleton exposure
//-----------------------------------------------------------------------------
extern CWorldLights *g_pWorldLights;

不确定如何解决这个问题,如果有人有任何帮助,我将不胜感激!

1 个答案:

答案 0 :(得分:0)

1)首先需要将文件添加为单独的项目 - 静态库。

2)转到你的

  

项目 - > rightclick->属性 - >配置   属性 - >链接器 - >附加依赖项

这里添加与路径一起生成的lib文件。

您在上面看到的内容称为name mangling

相关问题