Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22072

vscode gcc.exe errors: main.c: No such file or directory & fatal error: no input files

$
0
0

I have encountered this problem. This is my code:

#include<stdio.h>
 int main()
     {
          int x;
          x=1.5+7%3*(int)(2.5+4.7)%2/4;
          printf("%d",x);
          getchar();
     }

It's a simple c program. When I tried to compile the file, i found:

gcc.exe: error: main.c: No such file or directory
gcc.exe: fatal error: no input files

My problem

Is that related to settings in launch.json? My shell is powershell. Here is my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C/C++",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\MinGW\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
        },
    ]
}

I am willing to learn.

Mod edit: removed off-topic question - see topics, point 4


Viewing all articles
Browse latest Browse all 22072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>