在qt中运行代码时遇到错误 [英] Error faced when running a code in qt

查看:138
本文介绍了在qt中运行代码时遇到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行我在Qt中编写的代码时,我不断收到此错误。

我已将链接附加到错误的屏幕截图。

错误的屏幕截图

链接到代码存储库:GitHub - UA12 /秒表 [ ^ ]



我尝试了什么:



我一直试图了解问题所在,但一直无法做到所以,因为我是Qt的新手。

I keep getting this error when I try running a code that I wrote in Qt.
I have attached the link to the screenshot of the error.
The screenshot of the error
Link to the code repository: GitHub - UA12/Stopwatch[^]

What I have tried:

I have been trying to understand what the problem is but haven't been able to do so since I am new to Qt.

推荐答案

这个错误不是Qt或任何其他框架所特有的。这是一个连锁错误意味着无法找到所指出的方法。通常您会认为您已经为类实现了该方法,但您的函数签名与标题的定义不同。您似乎需要正确实现secChanges,minChanges和hrsChanges。
This error is not unique to Qt or any other framework. It is a linkage error meaning the methods noted can not be found. Often you will think you have the method implemented for a class but your function signature differs from the header's definition. It appears that you need to correctly implement secChanges, minChanges, and hrsChanges.


Rick 所述,这是关于缺少方法的常见链接器错误。

现在,查看您的代码,您在 secChanges 上定义了 ,在 > minChanges on hrsChange 方法,但您显然正在调用(请参阅错误消息) secChanges minChanges hrsChanges 。你能发现名称不匹配吗?你必须在方法调用上添加一个' on '。
As Rick stated, this is a common linker error about missing methods.
Now, looking at your code, you defined onsecChanges, onminChanges and onhrsChange methods, but you are apparently calling (see the error messages) secChanges, minChanges and hrsChanges. Can you spot the name mismatches? You have to add a 'on' to the method calls.


这种链接器错误是缺失的结果这些功能的实施。通常是缺少实现,一些拼写错误或范围错误(类或私有)的原因。转到功能实施和fixit的地方。
This kind of linker error are the result of missing implementation of these functions. Often is missing implementation, some typo or wrong scope (class or private) the reason. Goto to the place where the functions are implemented and fixit.


这篇关于在qt中运行代码时遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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