Line Location Tool:0: Command /Developer/usr/bin/g++-4.0 failed with exit code 1
Line Location Tool:0: duplicate symbol StartProfile::question::question()in /Users/Nicky/Desktop/MyMultiplication/build/MyMultiplication.build/Debug/MyMultiplication.build/Objects-normal/i386/Startup.o and /Users/Nicky/Desktop/MyMultiplication/build/MyMultiplication.build/Debug/MyMultiplication.build/Objects-normal/i386/main.o
But the question is, where is the duplicate symbol?
Why are you including a source file in your main source file? That's extremely non-standard.
My guess is that your IDE/compiler is compiling Startup.cpp into its own object file containing a definition of that method, and then compiling main.cpp - which includes Startup.cpp - into an object file which also contains a definition for that method.
Then, when it links them, it discovers that there are two definitions, one in in each object file.
Well, following both of yours ideas, I get these errors:
Line Location Startup.cpp:16: error: no 'int StartProfile::question()' member function declared in class 'StartProfile'
Line Location Startup.cpp:16: error: ISO C++ forbids declaration of 'question' with no type
Line Location Startup.cpp:17: error: 'a' was not declared in this scope
Line Location Startup.cpp:18: error: 'b' was not declared in this scope
Line Location Startup.cpp:19: error: 'answer' was not declared in this scope
Note that StartProfile::question::question is a constructor for the question type, which is a class containing a, b, and answer.
Ah - hadn't spotted that question was itself a class, nested inside the Startup class. In that case, it should be restored to how you previously had it. My apologies.
Hokay, after un-typedefing question, i get two errors.
Line Location Tool:0: "StartProfile::~StartProfile()", referenced from:
Line Location Tool:0: _main in main.o
Line Location Tool:0: "StartProfile::StartProfile()", referenced from: