运算符重载错误 [英] Operator Overloading Error

查看:91
本文介绍了运算符重载错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一个奇怪的错误,一个我以前从未见过的错误。


错误LNK2019:未解析的外部符号" public:__ thiscall Complex :: ~Complex(void)" (?? 1Complex @@ QAE @ XZ)函数_main


我也收到致命错误:


致命错误LNK1120:1未解决的外部因素


如果我这样做:#include" Complex.h"这会照顾到最大的错误,但是我仍然会收到致命的错误。


我不确定是什么原因造成的。任何想法??

展开 | 选择 | Wrap | 行号

解决方案

据我所见,你忘记了定义你的~Complex()dtor,但你确实声明了

it;你必须定义它。


亲切的问候,


Jos



据我所知,你忘了定义你的~Complex()dtor,但你确实声明了

;你必须定义它。


亲切的问候,


Jos



真棒乔斯。我正在看我过去的课程和书中,我(或作者)没有定义他们的析构函数。但是这样做了。



谢谢,


J


发现问题....程序正在运行。



感谢那些看了并提供建议的人。


J

I am receiving a strange error, one I have never seen before.

error LNK2019: unresolved external symbol "public: __thiscall Complex::~Complex(void)" (??1Complex@@QAE@XZ) referenced in function _main

I also receive a fatal error:

fatal error LNK1120: 1 unresolved externals

If I do: #include "Complex.h" that takes care of the top error, however I still receive the fatal error.

I''m not sure what could be causing these. Any ideas??

Expand|Select|Wrap|Line Numbers

解决方案

As far as I can see you forgot to define your ~Complex() dtor but you did declare
it; you must define it then.

kind regards,

Jos


As far as I can see you forgot to define your ~Complex() dtor but you did declare
it; you must define it then.

kind regards,

Jos


Awesome Jos. I am looking at my past programs and in the book, and nowhere did I (or the author) define their destructor. That did it though.


Thanks,

J


Found the problem....program is working.


Thanks to those who took a look and offered advice.

J


这篇关于运算符重载错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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