There's something wrong with the codeblocks configuration. It's running the "raw" file, and not the compiler. Check in your options if the "c++ compiler" is set. It should be set as "gcc".
I'm sorry i can't help you further into this task. I'm not on my Ubuntu PC right now, so i can't check the equality of the options. It should be anyways somewhere around Options/Compiler or something like that. There should be a page with many Edit Boxes put in vertical, like:
C++ Compiler: [EDITBOX]
C Compiler: [EDITBOX]
Something Else: [EDITBOX]
Something Else Again: [EDITBOX]