Sublime Forum

Compiling C/C++ and GCC can't be found? Looked at all boards on the internets

#1

I’ve literally been on like 10 different boards from stack exchange to all sorts of youtube videos. (Do you guys have a youtubes?) How do you get sublime set up to compile and execute c programs? I will be taking a C++ class here within the month and would like to set that up to…

0 Likes

#2

Can you open a terminal (Command prompt/Powershell prompt/Cmder shell/etc) and type gcc --version or something similar and get anything? I think that would probably be the first step in making sure a program has visibility for finding your compiler.

1 Like

#3

Your path looks like it’s correct (assuming that c:\cygwin64 is where your copy of Cygwin is installed). Note that if you modify the path while Sublime is running, the change won’t be seen until you restart Sublime.

It’s cut off in your image; in the error diagnostic under the failed build, does the list of items in the path include the cygwin directory?

0 Likes

#4

Screenshot%20(137)

0 Likes

#5

This is the exact error

The system cannot find the path specified.
[Finished in 0.1s with exit code 1]
[cmd: [‘gcc sublime_practice.c -o sublime_practice && ./sublime_practice’]]
[dir: C:\Program Files (x86)\Python\c_work]
[path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Sublime;C:\Program Files (x86)\Sublime\Sublime Text 3\Packages\Users;C:\Users\t540p\AppData\Roaming\Sublime Text 3\Packages\User\C_PROGRAM_RUN.sublime-build;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files (x86)\DevC++\Dev-cpp_work;C:\cygwin64\bin;C:\cygwin64;C:\Program Files (x86)\Python\c_work;C:\Program Files (x86)\Python\Scripts;C:\Program Files (x86)\Python;C:\Users\t540p\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\VSCode\Microsoft VS Code\bin;C:\Program Files (x86)\Python\c_work;]

0 Likes

#6

Have you installed gcc with cygwin? It doesn’t ship out of the box. See https://stackoverflow.com/questions/47215330/how-do-i-install-gcc-on-cygwin for install instructions

0 Likes

#7

Will try. Keep you posted.

0 Likes