C++ 致命错误 LNK1120:4 个未解析的外部
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21361308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fatal error LNK1120: 4 unresolved externals
提问by Благовест Тодоров
I am new to game developing, i am interesed in Goldsrc(Valve's early engine). I found source code of Counter-Strike 1.6 (Modified Goldsrc) and tried to compile it with VS2013.
我是游戏开发的新手,我对 Goldsrc(Valve 的早期引擎)很感兴趣。我找到了 Counter-Strike 1.6 (Modified Goldsrc) 的源代码,并尝试用 VS2013 编译它。
Few errors came up - http://imagizer.imageshack.us/v2/800x600q90/809/qdfh.pngModied Goldsrc - http://www.mediafire.com/download/798fcj9tb771r6z/CSSDK-master.rar
出现了一些错误 - http://imagizer.imageshack.us/v2/800x600q90/809/qdfh.pngModied Goldsrc - http://www.mediafire.com/download/798fcj9tb771r6z/CSSK-master.rar
回答by Victor
Generally, this error comes when you call something that is not defined. (E.g You call a function that has no body in the file you are #include
-ing in your source code)
通常,当您调用未定义的内容时会出现此错误。(例如,您#include
在源代码中调用的文件中没有主体的函数)
An undefined external symbol (symbol) was found in function. To resolve this error, provide a definition for symbol or remove the code that references it
在函数中发现未定义的外部符号(符号)。要解决此错误,请提供符号定义或删除引用它的代码
As it is said on Microsoft's website. You can find ways to solve this error following their tips.
正如微软网站上所说。您可以按照他们的提示找到解决此错误的方法。
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
The symbols definitions are located in the .lib
file provided bu Visual Studio when you compile a DLL. Basically, you have to include that .lib
. file in your executable file.
符号定义位于.lib
编译 DLL 时由 Visual Studio 提供的文件中。基本上,你必须包括那个.lib
. 文件中的可执行文件。
Right click on your project in the Solution manager dialog and click Properties
. You have to go to the Common Properties
, then click Add New Reference
.
在解决方案管理器对话框中右键单击您的项目,然后单击Properties
。您必须转到Common Properties
,然后单击Add New Reference
。