Hello!
I need help, to understand how to deal with the bash in my path to build and run C++ 11 and C++ 14
C++ Build System, build and run perfectly fine!!!
C++11 Build, but not Run. (It let me run .exe file manually with PowerShell or CMD)
my C++11.sublime-build file:
{
"cmd": ["g++", "-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd":["bash", "-c", "g++ '${file}' -std=c++11 -stdlib=libc++ -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
C++14 Doesn’t Build & Run.
my C++14.sublime-build file:
{
"cmd":["bash", "-c", "g++ -std=c++14 -Wall '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd":["bash", "-c", "g++ -std=c++14 '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
The error I got to the console:
[WinError 2] The system cannot find the file specified[cmd: ['bash', '-c', "g++ -std=c++0x 'C:\Users\FTP-RSky\Desktop\RSky\rect\test_g++11.cpp' -o 'C:\Users\FTP-RSky\Desktop\RSky\rect/test_g++11' && xterm -e bash -c 'C:\Users\FTP-RSky\Desktop\RSky\rect/test_g++11; read'"]] [dir: C:\Users\FTP-RSky\Desktop\RSky\rect] [path: C:\Program Files\Processing-3.2.1;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files\Java\jdk1.8.0_73\bin\lib;C:\Program Files\Java\jdk1.8.0_73\bin] [Finished]
Using POSIX paths, will it really helps to solve this problem or is some other way to setup Build System properly for modern C++ 14 standard?
Thanks!