![]() |
| ||
| Error message help? Hello, when i try to compile this program (it has three parts) I receive an error message that confuses me. Below are the code and error message. #include <iostream> #ifndef Complex_H #include <iostream> The error msg says: C:\IS20\Complex Classes\Complex.cpp(16) : error C2556: 'void __thiscall Complex::add(class Complex &)' : overloaded function differs only by return type from 'class Complex __thiscall Complex::add(class Complex &)' c:\is20\complex classes\complex.h(10) : see declaration of 'add' C:\IS20\Complex Classes\Complex.cpp(16) : error C2371: 'add' : redefinition; different basic types c:\is20\complex classes\complex.h(10) : see declaration of 'add' C:\IS20\Complex Classes\Complex.cpp(17) : error C2065: 'a' : undeclared identifier C:\IS20\Complex Classes\Complex.cpp(17) : error C2228: left of '.realPart' must have class/struct/union type C:\IS20\Complex Classes\Complex.cpp(18) : error C2228: left of '.imagineryPart' must have class/struct/union type C:\IS20\Complex Classes\Complex.cpp(22) : error C2556: 'void __thiscall Complex::subtract(class Complex &)' : overloaded function differs only by return type from 'class Complex __thiscall Complex::subtract(class Complex &)' c:\is20\complex classes\complex.h(11) : see declaration of 'subtract' C:\IS20\Complex Classes\Complex.cpp(22) : error C2371: 'subtract' : redefinition; different basic types c:\is20\complex classes\complex.h(11) : see declaration of 'subtract' C:\IS20\Complex Classes\Complex.cpp(23) : error C2065: 's' : undeclared identifier C:\IS20\Complex Classes\Complex.cpp(23) : error C2228: left of '.realPart' must have class/struct/union type C:\IS20\Complex Classes\Complex.cpp(24) : error C2228: left of '.realPart' must have class/struct/union type C:\IS20\Complex Classes\Complex.cpp(30) : error C2061: syntax error : identifier 'dounle' C:\IS20\Complex Classes\Complex.cpp(33) : error C2065: 'ip' : undeclared identifier C:\IS20\Complex Classes\Complex.cpp(36) : error C2556: 'bool __thiscall Complex::equal(class Complex &)' : overloaded function differs only by return type from 'class Complex __thiscall Complex::equal(class Complex &)' c:\is20\complex classes\complex.h(14) : see declaration of 'equal' C:\IS20\Complex Classes\Complex.cpp(36) : error C2371: 'equal' : redefinition; different basic types c:\is20\complex classes\complex.h(14) : see declaration of 'equal' I do not understand what that means. Can anyone help me? Thanks so much, I really appreciate it a lot. |
| ||
| Re: Error message help? Hi, thanks for reading my message. I've changed my code a bit and I get it to compile but the math is wrong. #include <iostream> #include <iostream> #ifndef Complex_H Could you please look this over and tell me what myself and the debugger are messing up? Also, how do I make use of the equal function so that it doesn't just sit there? Thanks for your help. |
| All times are GMT -4. The time now is 11:57 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC