Ask coding questions

← Back to all posts
Can't run program after rename
Thundrstruck87 (2)

I created my first file called "main.cpp" and since added code to it, I've renamed it to "DetailBase.cpp" and now after pushing the changes to GitHub, when I try to run the program it gives me the attached error. What do I do to fix this so I can run and test my program? I've tried to close and reopen the program file and relaunch replit on a new tab with no success :(

Answered by ch1ck3n (2055) [earned 5 cycles]
View Answer
Comments
hotnewtop
ch1ck3n (2055)

change it back to main.cpp or it won't work

OR:

make a file named .replit.

put this code in it:
run="clang++-7 -pthread -std=c++17 -o DetailBase DetailBase.cpp && ./DetailBase"

Thundrstruck87 (2)

@ch1ck3n Ah thank you!! That worked!

EpicGamer007 (1736)

create a .replit file and put run="clang++-7 -pthread -std=c++17 -o DetailBase DetailBase.cpp && ./DetailBase"