0

Sublime Text 3 doesn't run code after cin on my Windows OS system. c++ code is running smoothly in Visual Studio Code.

What should I do?

#include <iostream>
using namespace std;
int main()
{
    int n;
    cout<<"Ente the value of n "<<endl;
    cin>>n;
    cout<<"value of n is="<<n<<endl;
    return 0;
}

The error is:

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe:
cannot open output file
C:\Users\suraj\Desktop\resume\jayalji\background-generator/test.exe:
Permission denied collect2.exe: error: ld returned 1 exit status
[Finished in 0.6s]
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • 1
    What is the exact compile command? Did you try to remove `C:\Users\suraj\Desktop\resume\jayalji\background-generator/test.exe` manually? – Thomas Sablik Jun 01 '20 at 01:04
  • 1
    You can't run interactive programs in Sublime without using something like [Terminus](https://packagecontrol.io/search/Terminus). You can't link because the program is still running from your previous build, stuck in the background waiting for input you can't provide, and windows won't let you replace an executable while the program is running. – OdatNurd Jun 01 '20 at 01:26

0 Answers0