This is what the compiler shows as error:
error: undefined reference to 'Abc::Abc()'
error: undefined reference to Abc::Abcde()'
error: 1d returned 1 exit status
What is causing the problem and what's the solution?
While trying seperate files, something goes wrong.
Did you add the files to the project in CodeBlocks? The code looks fine. There should be menu options to do that. There should also be options to create a class, if you use it, it will add the files automatically.
@ Aeluwin
Even though an implicit 0 is returned from main when there is no return statement, there is nothing stopping one from returning something anyway.
Well if you used the menu to create the class it should work. Are all 3 files in the same directory? Before, presumably you had all the code in main.cpp, are all the new files in that same directory? I no longer have C::B on my current computer, so I can't give much more help. Anyway linker errors mean that it can't find the definition of the function, which probably means in this case it can't find the files.
Give me about 20 minutes to compile this on Code::Blocks and I'll try to help you out. Looking at the code, there's not really any syntax problems, could just be something with files, or your directory or options in the compiler. I'll try my best friend :)
Honestly I'm not sure how my code compiled and worked. I tested it, it ran. Then I tested it by making it into one file, and it ran.. The code in one file is below
I'm guessing the "return 0;" messed everything up somehow, or perhaps not adding the #include <iostream>, since before, the program couldn't write into the input/output streams without it. But the definite reason is beyond me.
My guess would be like others are saying, and you didn't properly create your project.