SUBLIME TEXT- ERROR

So, I have been using sublime text to compile and run my codes I am facing the following issues. Please don’t copy paste answers from stack overflow. I am genuinely seeking some help:

  1. collect2.exe: error: ld returned 1 exit status This keeps popping up again ana again how to resolve it?
  2. How to run my programs from the terminal directly if not from Sublime Text

@rachitbansal2500,

  1. Open task manager and kill Sublime Text. Also restart you computer.
  2. In terminal, go to the directory of your source code, then type and press enter
    g++ A.cc(A.cc is the file you want to compile) ->This will make an executable file called a.exe(in windows) or a.out(in linux). You can run this executable by typing ./a.out(in linux) or a.exe(in windows)
1 Like

Also, I did set up the whole competitive environment. Still the windows sometimes work and show the ouput/input and other times they do not

@rachitbansal2500,
for windows try A.exe
make sure the code (here LS.cpp) and the input/output txt files are in the same directory

1 Like

So the second issue got resolved thank you so much. However, the first issue still persists. I cannot run the file through the terminal.

@rachitbansal2500,
What happens when you type A.exe and hit enter, if it does not shows any error, (but also not the output) it is because of you freemen statements, if you want to run your code entirely in terminal, comment out the #ifdef section and then compile an try.

So I did comment out the #ifndef statements however, I am still not receiving any error and the program isn’t running either. (I did save the file after commenting)

@rachitbansal2500,
You also have to compile it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.