Unable to excute c++ program in two different files

i am currently executing c++ programs in replit. eventhough i created two new files which has no relation to each other i am unable to execute the program
/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: /tmp/simple-600d0b.o: in function `main': /home/runner/C/./simple.cpp:4: multiple definition of `main'; /tmp/constuctor-19e0bf.o:/home/runner/C/./constuctor.cpp:4: first defined here.
this shows up in console

Current behavior:

Desired behavior

Repl link:

code snippet

Welcome to the forums, @kamreen0504!
You cannot have 2 C++ (.cpp) files on your repl, and if you would like to do so, try using a H++ (.hpp) files instead.


Don’t you mean .cpp?

1 Like