|
|
#1 |
|
Class redefinition error
Hi everyone,
First of all I'm pretty sure I'm not the first one to get this error but every similar thread I found either didn't get me an answer or wasn't relevant enough. So, why not try creating my own thread? In some obscure Financial Engineering class, I have to use different math transforms (some using fft). In order to make it work I had to create two classes: Complex and Options. The first time I ran my code, in order to test the methods within the classes, everything worked fine. But now, everytime I build, I get a Semantic Issue - Redefinition of 'Complex' // 'Options'. Then XCode points out the fact I included the header files in other .cpp // .h files and they tell me the previous definitions are there. I really don't get what I should do! BTW, I'm under Snow Leopard and using XCode 4.0.1 Below my header for one of my classes, and I'm #includ-ing it in several other files. Thanks! Code:
class Complex {
public:
Complex(float realpart=0, float imaginarypart=0);
Complex Add(const Complex &c) const;
float GetReal() const;
float GetImaginary() const;
void SetReal(float r);
void SetImaginary(float i);
void fft(double* x);
Complex Multiply(const Complex &a) const;
Complex power(float p) const;
float norm() const;
Complex coshC() const;
Complex sinhC() const;
Complex cothC() const;
float arg() const;
Complex expComplex() const;
void outprint() const;
private:
float real;
float imaginary;
};
|
|
|
|
0
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| 10.6 script on 10.4 machine doesn't work - "class alst" error?? | steevg | Mac Programming | 1 | Jan 7, 2011 06:52 AM |
| Xcode class inheritance error in C++ | macuser571 | Mac Programming | 2 | Dec 3, 2009 01:12 PM |
All times are GMT -5. The time now is 05:05 PM.







Threaded Mode
