Terminal in Codecademy doesn't work in C++

Example: https://www.codecademy.com/courses/learn-c-plus-plus/projects/cpp-dog-years?action=resume_content_item

When I use codecademy, the terminal has never worked so far, always because of the same error:

multiple definition of ‘main’

However, I only have declared one main function, and when I put the same code into codeblocks the code works and there’s no issue of there being multiple ‘main’ functions.

That’s working a whole lot. Look at the command you ran, there are indeed two main’s in what you specified.

1 Like

I’m new to programming so I’m not sure: where is the second main function? I only see the one in line 4

You asked g++ to compile two files

1 Like