Windows C Toolchain Easy Setup (Mingw + Notepad)

Posted by: Chao Category: code Comments: One Comment

Windows C Toolchain Easy Setup (Mingw + Notepad)

Install mingw +GCC on windows, find mingw installer on google:

https://sourceforge.net/projects/mingw/

Install mingw base and gcc in installer:

Setup environment path:

in control panel – system and safe – system – advanced system setup – environment setup and find path

Check if the path is working correctly:

enter into console CMD: gcc -v

Install notepad, recommanded version is 7.56, which has better support for plugins. Start to test simple hello print code:

#include <stdio.h>

int main() {
	int i = 10;
	printf("i=%d\n", i);
	printf("Hello 111\n");
}

Use notepad “run” function from the menu, enter following command for compiling:

cmd /k gcc -o “$(CURRENT_DIRECTORY)\$(NAME_PART).exe” “$(FULL_CURRENT_PATH)” & pause & exit

This will compile the current c file in notepad into windows executable file .exe, same name in the same folder.

And run command to run this exe file:

cmd /k “$(CURRENT_DIRECTORY)\$(NAME_PART).exe”

These two commands can be saved in notepad menu “run”:

C compiler GCC in windows can help you to quick start with c code learing, also try many preincluded functions like:

  • memcpy()
  • getkey()
  • printf()

These functions are pre-included in the string or stdio headers:

#include <stdio.h>
#include <string.h>

Share this post

Comment (1)

  • Bursa Ajans Reply

    It is a subject I researched, I like it very much. Thanks, I will follow closely. 🙂

    March 27, 2020 at 4:02 am

Leave a Reply

Your email address will not be published. Required fields are marked *