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
    Use the upper table entitled "User Variables for" and select the "Path" directory.
  • Question
    What is a good compiler for C language?
    Community Answer
    The MinGW GCC compiler will work well.
  • Question
    Is the extension .exe necessary in a compiling program?
    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
    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
    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
    You just open a text editor and write your code and then follow the instructions above to compile.
Ask a Question

      Return to Full Article