How do I compile with MinGW?

How do I compile with MinGW?
Answer
Install the MinGW Tools for C/C++
  • Log in to your regular user account.
  • Download this MinGW folder and run it.
  • Accept the default installation folder C:\MinGW.
  • At the Select Component dialog, check the MSYS Basic System.
  • Add the C:\MinGW\bin folder to your Windows Path variable.
  • Next, verify that the MinGW install was successful.
Photo in the article by “Flickr”
Code:
https://www.flickr.com/photos/xmodulo/9366550141/in/photostream/
Run a C/C++ program on terminal using gcc compiler
  • Open terminal.
  • Type command to install gcc or g++ complier:
  • Now go to that folder where you will create C/C++ programs.
  • Open a file using any editor.
  • Add this code in the file:
  • Save the file and exit.
  • Compile the program using any of the following command:
  • To run this program type this command:
 

Tìm kiếm

Back
Top