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

"No such file or directory" error when active file ${file} is in subdirectory

$
0
0

Using VS Code and my tasks.json reads....

"label": "echo",
"type": "shell","command": "gcc","args":["-g", "${file}", "-o", 
"${fileDirname}\\${fileBasenameNoExtension}.exe"],
"group": {"kind": "build","isDefault": true}}

I'm getting an error on build...

Executing task: gcc -g c:\Users\user\CODEmainDirectory\Subdirectory\main.c -o c:\Users\user\CODEmainDirectory\Subdirectory\main.exe <

gcc.exe: error: c:UsersuserCODEmainDirectorySubdirectorymain.c No such file or directory

Works fine if I move the active file up to the main directory but not in a subdirectory.

Here's my c_cpp_properties.json for the includes.....

"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
},
{
"name": "GNU",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4

Viewing all articles
Browse latest Browse all 22298

Latest Images

Trending Articles



Latest Images

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