Ask coding questions

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

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 [earned 5 cycles]
View Answer
Voters
Thundrstruck87
Comments
hotnewtop
ch1ck3n

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

@ch1ck3n Ah thank you!! That worked!

EpicGamer007

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

Thundrstruck87

Thank you!!
@EpicGamer007