Ask coding questions

← Back to all posts
My C++
EhanireOghogho

Why is it that my code gives me an error whenever I add a new file to a Repl I created

Voters
EhanireOghogho
Comments
hotnewtop
Coder100

Hi, replit tries to compile both of the files into the same cpp file, so you have to configure the run button:
https://docs.replit.com/programming-ide/configuring-run-button#configuring-the-run-button

Here is the code you could add in your .replit file:

And then to run the other file:

juliusgunnars12

Change the main to something else, it worked for me. There are two main() change one of their names to main2() or something...

EhanireOghogho

thank you, it's working now
@juliusgunnars12