1

I am having problem executing a cpp file after compilation. Here is the text output and how I compile it and try to run.

coovi@coovi-Surface-Book:~/HW9$ g++ -Wall main.cpp -g -o main
coovi@coovi-Surface-Book:~/HW9$ chmod +x main
coovi@coovi-Surface-Book:~/HW9$ ./main
Can not open the file
mecofe
  • 63
  • 6
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/76762/discussion-on-question-by-meha-felix-can-not-open-cpp-excutable-after-compilatio). – Thomas Ward Apr 29 '18 at 20:19

1 Answers1

1

You're having problems with your source code. It's executing. The compiling commands were executed correctly. The error is being generated by your program that when it runs.

You'll have to debug your source code to fix it.

It's great practice to code with a text editor. But you might consider using a GUI such as Eclipse to assist in the debugging of your source when it grows a little big for handing.

L. D. James
  • 24,768
  • 10
  • 68
  • 116
  • It still doesn't work, in try to Uninstall and reinstall gcc and gpp. But same thing. Is there anything suplementary file I need to install? I am using Ubuntu 18.04 – mecofe Apr 29 '18 at 18:25
  • Copy your text from [the link you posted](https://drive.google.com/open?id=1-DLa1NDIJgU6tlM6w62wNF3qHx78QM_L) and paste it into Gedit. Then compile it. – L. D. James Apr 29 '18 at 18:38
  • That is the process ther worked for me as well as Egon Stetmann. – L. D. James Apr 29 '18 at 18:39