LNK:2019和LNK:2028 Visual C ++表单应用程序中的错误 [英] LNK:2019 and LNK:2028 Errors in Visual C++ Form Application

查看:62
本文介绍了LNK:2019和LNK:2028 Visual C ++表单应用程序中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在Visual C ++中创建了一个简单的Windows窗体应用程序。它只有一个表格和两个班级。作为一个非常基本的测试,我只是在按下窗体上的按钮时创建其中一个类的对象。当我调用这个类的构造函数时,它给了我这个错误
。我已经搜索了这个错误的所有可能原因,并尝试了每个修复建议,但似乎没有什么对我有用。这两个类都是在项目中定义的,所以我真的不明白为什么我会收到这个错误。
构造函数的定义出现在类的cpp文件中。在这方面的任何帮助将不胜感激。

So I have created a simple Windows Forms Application in Visual C++. It only has one form and two classes. As a very basic test I am just creating an object of one of these classes whenever a button on the form is pressed. It gives me this error when I call constructor of this class. I have searched all possible reasons for this error and tried every fix suggested but nothing seems to be working for me. Both the classes are defined inside the project so I really don't see why I am getting this error. The constructor's definition is present in the cpp file of the class. Any help in this regard will be much appreciated.

推荐答案

您好
Intellisense90,

感谢您在此处发帖。

>> LNK:2019和LNK:2028 Visual C ++表单应用程序中的错误

>>LNK:2019 and LNK:2028 Errors in Visual C++ Form Application

请提供有关您的问题的更多信息。这些错误的详细信息是什么以及导致这些错误的相关陈述是什么?

Please provide more information about your issue. What's the detailed information of these errors and what's the related statements that causes these errors?

这种情况可能有多种原因。 如果构建中未包含具有符号定义的对象或库文件,则会发生此错误。如果链接器搜索的符号名称
与库中的符号名称或定义它的目标文件不匹配,也会发生这种情况。  我建议你查看这些东西下面。

There maybe multiple reasons for this case. This error can occur if the object or library file that has the definition of a symbol is not included in the build. It can also occur if the symbol name the linker searches for does not match the name of the symbol in the library or object file that defines it. I suggest you check these things below.


  1. 检查函数声明和函数定义之间的调用约定是否不同。验证调用约定是否相同。
  2. 尝试将模板类的声明和定义放入头文件中。

了解更多可能的原因,请参阅下面的这个文件。

For more possible reasons, please refer to this document below.

https:/ /msdn.microsoft.com/en-us/library/799kze2z.aspx

希望这可以帮到你。

最诚挚的问候,

Baron Bi

这篇关于LNK:2019和LNK:2028 Visual C ++表单应用程序中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆