Q&A for How to Compile a C Program Using the GNU Compiler (GCC)

Return to Full Article

Search
Add New Question
  • Question
    What do I do if there are two tables in the environmental variables window? In which table and directory should I add an environmental variable?
    Community Answer
    Community Answer
    Use the upper table entitled "User Variables for" and select the "Path" directory.
  • Question
    What is a good compiler for C language?
    Community Answer
    Community Answer
    The MinGW GCC compiler will work well.
  • Question
    Is the extension .exe necessary in a compiling program?
    Community Answer
    Community Answer
    Theoretically, as long as a file contains the necessary binary machine code, it could be run by a processor. One example is how on Windows, a screensaver is simply a program (just like a .exe) but with the .scr extension. However, as far as I know, most modern operating systems will not attempt to execute a file if it does not identify the file type as being executable, so you would need to somehow trick the operating system into actually starting a new process using the code from the file.
  • Question
    What can cause an error code stating that the GCC command was not found?
    Community Answer
    Community Answer
    This means that it was not properly installed on your computer. Try restarting the process.
  • Question
    What should I do if the command prompt keeps telling me that "GCC" is not an internal or external command or batch file?
    Community Answer
    Community Answer
    Likely either some part of the installation went wrong or you didn't connect it to your PATH. See step 8 for connecting it to your PATH and if that doesn't work, try to re-install.
  • Question
    How do I write C code in the GCC compiler on Ubuntu?
    Community Answer
    Community Answer
    You just open a text editor and write your code and then follow the instructions above to compile.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

Return to Full Article

You Might Also Like

Compile a C ProgramCompile a C Program
Compile CPP File to EXE Compile a CPP File to an EXE using MinGW or Microsoft Visual Studio
Run C Program in Command Prompt Run a C Program Using Developer Command Prompt
Download, Install, and Use Code::Blocks Download, Install, and Use Code::Blocks
Code in CCode in C
Use Wine on Linux Install and Use Wine on Linux
Download VS Code Download Visual Studio Code
Set Up OpenGL GLFW GLEW GLM on a Project with Visual StudioSet Up OpenGL GLFW GLEW GLM on a Project with Visual Studio
Compile & Run Java Program Using Command PromptA Beginner’s Guide to Compiling & Running Java Programs
Run a Program from the Command Line on LinuxRun a Program from the Command Line on Linux
Install Windows Programs in UbuntuEasily Run Windows Applications on Ubuntu Linux with Wine
Set Up SDL with Visual Studio Set Up SDL with Visual Studio
Install Mesa (OpenGL) on Linux MintOpenGL on Linux Mint: Easy Mesa Install Guide
Install Game Maker Studio on LinuxInstall GameMaker Studio 2 on Ubuntu Linux: Setup Guide