When I add a 2nd file, I get an error and my code doesn't run on that file.
EdwardGomez (1)

Hello everyone,
I just started using repl.it and so far its great for a quick coding program!

I am using it for a C++ class and the professor gives us multiple examples to note down.
When I create a new repl and use the main.cpp file I type
#include <iostream>
using namespace std;
int main() {
then I begin to code the example. But when I try to add a new file and start with the same beginning 3 lines of code it gives me an error when running the code it says: /tmp/number-76d309.o: In function main': number.cpp:(.text+0x0): multiple definition ofmain'
/tmp/age-f5685b.o:age.cpp:(.text+0x0): first defined here
clang: error: linker command failed with exit code 1 (use -v to see invocation)
compiler exit status 1

Does anyone know how to bypass this? It would be cool to make new files for each coding example the professor gives us.

Thanks for the help!

You are viewing a single comment. View All
EdwardGomez (1)

Damn alright, thank you for the quick reply! @theangryepicbanana