Help with Code::Blocks

So i got CodeBlocks with miniGW and i am reading "Sams Teach Yourself C++" and i am only just in the first hour trying to write the first source code and i know it looks right but i continue to get errors and basically im wondering if the book maybe is out of date with codebloacks or if im doing something wrong

Source code is:

#include <iostream>

int main()
{
std::cout << "Solidum petit in profundis!\n";
return 0;
}

and error is:
obj\Debug\main.o||In function `main':|
C:\Users\owner\Desktop\C++\motto\main.cpp|6|multiple definition of `main'|
obj\Debug\motto.o:C:\Desktop\C++\motto\motto.cpp|4|first defined here|
||=== Build finished: 2 errors, 0 warnings ===|

if anyone has any idea it would be much appreciated
Thanks :)

Last edited on
Apparently you added two source files to your project, each having its own main function. So just fix that.
ahh thanks so much i didnt even realize it would cause i problem :)
Topic archived. No new replies allowed.