Comments (15)
O great finally it works. Seems like I had McAfee working all the while.
from vs-code-config.
Tell me somehting :
-
Open terminal in the vs code
-
Go to the cpp file directory
cd Programs
-
Use manual command
- Build
g++ test.cpp -o test.out
- Run
./test.out
is this working fine in your machine ?
Is there any anivirus running ? like avast or something which can prevent running programmes ?
You can also delete the test.cpp file and create a new one and try again !
from vs-code-config.
Yeah I tried the manual build commands but it asks for user input via the terminal itself instead of reading from the input.txt file. Moreover output it showing up inside the terminal.
Here's the commands I used inside Programs folder:
- g++ test.cpp -o test.out
- ./test.out
I tried the above commands after disabling Windows defender (I don't have any additional antivirus installed) and got the same result.
P.S.: Ctrl+Shift+B is producing the same error.
from vs-code-config.
@sandip2224 i think it's the test.exe file which is making the error ! Delete this and try ctrl+shift+b
Is ctrl+shift+b
making the exe file ?
from vs-code-config.
Tried reinstalling MinGW and re-checked environment variable path.
So weird but now it WORKS just fine with Ctrl+Shift+b
using test cases from input.txt
and prints result to output.txt
. Only had to add these lines inside my main() function.
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
Could you please explain how/why this works?
P.S.: I used the following manual build commands:
- g++ test.cpp -o test.out
- ./test.out
from vs-code-config.
MinGW was working fine in your machine that's why i asked to use manual commands.
Isn't it working without "freopen" in your main function ?
And i have also asked a question that "was my script creating the exe file ? " @sandip2224
from vs-code-config.
It's not working without the "freopen" inside main, and no, the Ctrl + Shift + b
isn't creating the .exe file
from vs-code-config.
If it's not creating the exe file then just delete the exe file and try the shortcut (Ctrl + Shift + b) ?
from vs-code-config.
I just did. It's stuck at ./test.out
without the 'freopen'. And works just fine with that.
from vs-code-config.
using Ctrl + Shift + b
in vscode got stuck in ./test.out? I am not saying to use manual command from the terminal .
from vs-code-config.
Okay give me a second. Here's what it's showing inside the bash terminal now. But I don't see any output in output.txt.
from vs-code-config.
give me the whole screenshot like this
from vs-code-config.
Before running Ctrl+Shift+b
:
After running Ctrl+Shift+b
:
from vs-code-config.
which task.json file you are using?
The fisrt one when you got the launch faild error and now you are giving me the pictures are not using same script i guess!
And 2nd question is : "where is the exe coming from ?
from vs-code-config.
Yup that's why I told you to check your free antivirus :3
btw I'm closing this issue .
from vs-code-config.
Related Issues (7)
- No such File or Directory error HOT 19
- Task not working with file name LearnC++.cpp HOT 4
- VSCode Default Terminal (Windows) as PowerShell HOT 2
- Vs code Config not working HOT 9
- Using time(failed to run command '/usr/bin/time': No such file or directory) HOT 2
- Problem regarding Task.json file Windows HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vs-code-config.