franneck94 / Vscode-C-Cpp-Runner

🚀 Compile, run and debug single or multiple C/C++ files with ease. 🚀
MIT License
53 stars 14 forks source link

adding include folders render the build command not working #73

Closed ajmandourah closed 2 years ago

ajmandourah commented 2 years ago

Hello,

I am trying to use MSVC but when Include folders the build command will not work

'C:\Program' is not recognized as an internal or external command,

would you look at that please,

image

franneck94 commented 2 years ago

Can you send a screenshot of the full console output?

ajmandourah commented 2 years ago

here you go image

.

franneck94 commented 2 years ago

Okay whenever there is an include dir which contains whitespaces, the error occurs. I am working on it.

Update: It seems like the VSCode Terminal has issues with whitespaces in general (again...)

ajmandourah commented 2 years ago

Any options to use an external terminal?

While at it, I noticed that options for setting vcvarsall.bat and include folders won't setup automatically in new projects rathat than I must set it in manually in user settings or in settings json file. Would be great if such would be automated. Especially for include folders.

ajmandourah commented 2 years ago

So I managed to find a workaround for now, its pretty dirty and messy but works well. Mainly using the windows file names shortcut which is still being used in the background, for example Program Files will translate to progra~1. when set like that I must change all the dir in the command line to the shortcut version including path to vsvarsall , include folders and such.

you can find what the folder name will translate to using "dir /x" in the folder and it will list its name and the shortcut name,

ajmandourah commented 2 years ago

the whole line will look sth like this

"C:\progra~1\MIB055~1\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 && cl.exe /W4 /Od /Zi /EHsc /IC:\progra~1\MIB055~1\2022\Community\VC\Tools\MSVC\14.31.31103\include\ /IC:\progra~2\WI3CF2~1\10\Include\10.0.19041.0\um /DYNAMICBASE kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib -DUNICODE /Fd.\build\Debug\ /Fo.\build\Debug\ /Fe.\build\Debug\outDebug.exe Source.cpp

franneck94 commented 2 years ago

Wasn't able to fix this in 4.0.0

franneck94 commented 2 years ago

76