VS Code Build Fails If Folder has Spaces
I am using STM32CubeIDE for Visual Studio Code
If I create an empty project in a folder with spaces the build will fail. I suspect the spaces create a double quote somehow.
In the command below, main.c is wrapped in two quotes, -c ""C:\Users\me\VSC_projects\STM first try\asdf\Src\main.c""
I suspect this makes gcc look for a file named main.c” instead of main.c. Plus “C:\ instead of C:\
Failing build due to spaces:
C:\Users\me\AppData\Local\stm32cube\bundles\gnu-tools-for-stm32\14.3.1+st.2\bin\arm-none-eabi-gcc.exe -DDEBUG -DRTE_DEVICE_STARTUP_STM32H5XX "-I"C:/Users/me/VSC_projects/STM first try/asdf/Inc"" "-I"C:/Users/me/VSC_projects/STM first try/asdf"" -fdata-sections -ffunction-sections -Wl,--gc-sections -Wno-comment -g -std=gnu11 -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mlittle-endian -mthumb -fstack-usage -Wall -Wextra -Wpedantic -Wno-unused-parameter -O0 -g3 -ggdb -o CMakeFiles\asdf.dir\Src\main.c.obj -c ""C:\Users\me\VSC_projects\STM first try\asdf\Src\main.c""
arm-none-eabi-gcc.exe: warning: "C:\Users\me\VSC_projects\STM first try\asdf\Src\main.c": linker input file unused because linking not done
arm-none-eabi-gcc.exe: error: "C:\Users\me\VSC_projects\STM first try\asdf\Src\main.c": linker input file not found: Invalid argument
Compilation finished with error(s).
Press any key to close the terminal…
Successful build in a folder without spaces
C:\Users\me\AppData\Local\stm32cube\bundles\gnu-tools-for-stm32\14.3.1+st.2\bin\arm-none-eabi-gcc.exe -DDEBUG -DRTE_DEVICE_STARTUP_STM32H5XX -IC:/Users/me/VSC_projects/STM_no_space/myHello/Inc -IC:/Users/me/VSC_projects/STM_no_space/myHello -fdata-sections -ffunction-sections -Wl,--gc-sections -Wno-comment -g -std=gnu11 -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mlittle-endian -mthumb -fstack-usage -Wall -Wextra -Wpedantic -Wno-unused-parameter -O0 -g3 -ggdb -o CMakeFiles\myHello.dir\Src\main.c.obj -c C:\Users\me\VSC_projects\STM_no_space\myHello\Src\main.c
Compilation finished successfully.
Press any key to close the terminal...
