How to Run C Program in Notepad++: Compile & Run C with MinGW

Поділитися
Вставка
  • Опубліковано 23 лис 2024

КОМЕНТАРІ • 75

  • @AmitChristian
    @AmitChristian  2 роки тому +3

    🚩
    🚩
    Steps (with Timestamps) 🚩
    🚩
    00:00 Demo of compiling and running C program from Notepad++.
    00:58 Install MinGW (Minimalist GNU for Windows)
    01:42 Install GCC, GCC++ Compilers in MinGW
    03:00 Setup an environment variable in PATH for MinGW's gcc.exe, so that Notepad++ can find the gcc.exe executable.
    05:20 Next, install NPPExec notepad++ plugin to execute C Program.
    05:50 Create a C Compiler script for Notepad++ NPPExec plugin. Copy the code below to create a new compiler option.
    06:48 Create a menu item in NPPExec for C Compiler
    08:00 Test run C Code from Notepad++
    09:55 Create keyboard shortcut for compiling and running C program from Notepad++

  • @fozzyprozzy1539
    @fozzyprozzy1539 3 роки тому +1

    Thanks mate finally got it to work was gonna give up on coding

    • @AmitChristian
      @AmitChristian  3 роки тому

      Glad to know that it was helpful. Thanks.

  • @Literally_Weird_Studios
    @Literally_Weird_Studios 4 місяці тому

    this was so helpful

  • @neerajchauhan2050
    @neerajchauhan2050 11 місяців тому +1

    Sir code not seeing properly which would be paste in the plugins execute NppExce command place, can you send me that code so that I can complete the process
    Thanks

  • @w.s.sithumini9881
    @w.s.sithumini9881 Рік тому +1

    thank you so much. very useful video.

  • @nc7341
    @nc7341 Рік тому

    Thanks a lot. I could set it up in one go.

  • @scp-3027
    @scp-3027 Рік тому +1

    thank you so much for this 🙏

  • @babceena6423
    @babceena6423 3 роки тому +6

    Hi, Sir. I followed the instructions. This message keep showing whenever I compile a code,
    "; about to start a child process: "a"
    CreateProcess() failed with error code 2:
    The system cannot find the file specified."
    ..... Maybe there's error somewhere but I 'm not sure where.

    • @AmitChristian
      @AmitChristian  3 роки тому +2

      Czane, I did some research and it seems that this issue can be due to Path issue. Check out this Stackoverflow post which describe similar issue. (stackoverflow.com/questions/43069561/c-mingw32-createprocess-failed-with-error-code-2-the-system-cannot-find-the). Hope it helps.

    • @LNguyen921
      @LNguyen921 2 роки тому +2

      Got the same issue too.

    • @Birdboxed023
      @Birdboxed023 14 днів тому

      First things first thank you Chris Amit, this video is the best online to get notepadd++ up and running. For those of you that are getting this code error :"; about to start a child process: "a"
      CreateProcess() failed with error code 2: TRY THIS! AFTER following the video completely:
      1.Press Win key and type Control Panel
      2.Open Control Panel and click on System and security, System,and then Advanced System Settings.
      3Click on Enviormental Variables
      4. Under system Variables click NEW
      5.Enter Variable Name as : MinGW
      6.Value: C:\MinGW\bin
      7. Save and restart Notepad++
      Hope this helps

  • @ojeid2915
    @ojeid2915 3 роки тому +2

    Hi, thank you for this video.
    I have a little question:
    everything worked, but when i try to open the .exe file, it start but the console closes immedialty.
    How can i keep the console open?
    Sorry if this is a stupid question :c

    • @AmitChristian
      @AmitChristian  3 роки тому +1

      @Ojeid, when the exe file is executed, it will close it after its execution. So, that is why you are seeing that it closes immediately. You can open a command prompt and then execute the exe in that.
      Then you will be able to see that it is printing "Hello World" in a console window.

  • @dixitvara
    @dixitvara Рік тому

    i followed the instructions and when user needs to give the input at that time i print message first that "Please enter numbers to addition" and i write after scanf function to take input but in console it takes input first and print message afterwords . any solutions ???

  • @nandanihada4461
    @nandanihada4461 3 роки тому +1

    Well Explained, thanks it worked for me.

    • @AmitChristian
      @AmitChristian  3 роки тому +2

      Thank you. I am glad that it was helpful.

  • @nirajbhuvad9440
    @nirajbhuvad9440 2 роки тому +1

    thank you sir👍

  • @gojotricked
    @gojotricked 2 роки тому

    great video very helpful

    • @AmitChristian
      @AmitChristian  2 роки тому

      Thank you Louis. Please like the video if you can.

  • @nishapv5129
    @nishapv5129 9 місяців тому

    Thank you very much.
    But I am getting error as below, while running C code for printing 'Welcome'.
    NPP_EXEC: "C Compiler"
    NPP_SAVE: C:\CPrograms\a.c
    CD
    Current directory: C:\Program Files\Notepad++
    C:\minGW\bin\gcc.exe -g "a.c"
    Process started (PID=18376) >>>
    gcc.exe: error: a.c: No such file or directory
    gcc.exe: fatal error: no input files
    compilation terminated.

    • @AmitChristian
      @AmitChristian  9 місяців тому

      Nisha, it could be due to spaces in the "Program Files", please take a look at this that goes into gcc compile error due to spaces in folder name. (superuser.com/questions/804276/gnu-gcc-compiler-fails-to-compile-when-path-contains-spaces-c)

  • @MusicWorld-xz4qe
    @MusicWorld-xz4qe 3 роки тому

    thank you for this video

    • @AmitChristian
      @AmitChristian  3 роки тому

      Music World, thank you. glad that it was useful. Please like or subscribe, if you can. Thanks.

  • @Samsam-mu7bi
    @Samsam-mu7bi 6 місяців тому

    Hello, I get this error whenever I try to compile: ; about to start a child process: "a"
    CreateProcess() failed with error code 2:
    The system cannot find the file specified.
    How do I fix it ?

    • @kingworld-v3i
      @kingworld-v3i 3 місяці тому

      i know where you getting problem
      you just rename your file like "hello.c" (apply dot C) and fu$kk the problem
      because the problem has been solved now.

    • @Birdboxed023
      @Birdboxed023 14 днів тому

      First things first thank you Chris Amit, this video is the best online to get notepadd++ up and running. For those of you that are getting this code error :"; about to start a child process: "a"
      CreateProcess() failed with error code 2: TRY THIS! AFTER following the video completely:
      1.Press Win key and type Control Panel
      2.Open Control Panel and click on System and security, System,and then Advanced System Settings.
      3Click on Enviormental Variables
      4. Under system Variables click NEW
      5.Enter Variable Name as : MinGW
      6.Value: C:\MinGW\bin
      7. Save and restart Notepad++
      Hope this helps

  • @Mankuthapa
    @Mankuthapa 3 роки тому +1

    Thanks sir,
    👌👌👍👍👍👍

    • @AmitChristian
      @AmitChristian  3 роки тому

      Neo thapa, thank you. I am glad it was useful.

  • @mrgabslethal4330
    @mrgabslethal4330 3 роки тому

    thank's for this video sir but i have a question; where did you get the code you inserted when you were asked for command(s)? cause i did all the steps and i'm blocked there ie i don't know were to get the code from; if you could help me with that please

    • @AmitChristian
      @AmitChristian  3 роки тому +1

      If I understand your question correctly, the code is included in the description of the video. Here it is.
      NPP_SAVE
      CD $(CURRENT_DIRECTORY)
      C:\minGW\bin\gcc.exe -g "$(FILE_NAME)"
      a

  • @sarangsalunkhe8032
    @sarangsalunkhe8032 4 місяці тому

    Sir which version of notepad ++ have installed

  • @theleadersway980
    @theleadersway980 2 роки тому

    hi , the title of the video in notepad++ do you do it manually or is there a way to generate it ?

    • @AmitChristian
      @AmitChristian  2 роки тому

      Hello The Leader's Way, I am using ASCIIArt to create those. It is not manual, you can easily create with a single command. I will make a video about how to create those, as there are number of people who have asked me the same thing. It is pretty cool. I will send you a video link once I upload it. Thank you for your comments.

    • @AmitChristian
      @AmitChristian  2 роки тому

      The Leaders Way, I have created a video that describes how to create ASCII text banner as you had asked. Please check this out. How to Create ASCII Text with Figlet on Windows and in Notepad++
      ua-cam.com/video/mC_OvZyeoUo/v-deo.html

  • @deepakkavale2787
    @deepakkavale2787 11 місяців тому

    Can we change the name of the compiled file from a.exe to any file name. Exe

  • @engineer483
    @engineer483 2 роки тому

    Thanks

    • @AmitChristian
      @AmitChristian  2 роки тому

      Saliha, you're welcome. (please like the video if you can). Thanks.

  • @yogeshvashisth2172
    @yogeshvashisth2172 Рік тому

    I found gcc in bin but its not not gcc.exe however its of same size as gcc.exe

    • @AmitChristian
      @AmitChristian  Рік тому

      Is it possible that the gcc extension is hidden in windows explorer?

  • @Edutroniko
    @Edutroniko 2 роки тому

    error: ; about to start a child process: "a"
    CreateProcess() failed with error code 2:

    • @AmitChristian
      @AmitChristian  2 роки тому

      Not sure what is this error due to. Does it create a log file that we can take a look for the error.

    • @Birdboxed023
      @Birdboxed023 14 днів тому

      First things first thank you Chris Amit, this video is the best online to get notepadd++ up and running. For those of you that are getting this code error :"; about to start a child process: "a"
      CreateProcess() failed with error code 2: TRY THIS! AFTER following the video completely:
      1.Press Win key and type Control Panel
      2.Open Control Panel and click on System and security, System,and then Advanced System Settings.
      3Click on Enviormental Variables
      4. Under system Variables click NEW
      5.Enter Variable Name as : MinGW
      6.Value: C:\MinGW\bin
      7. Save and restart Notepad++
      Hope this helps

  • @atom2919
    @atom2919 2 роки тому

    bro can u help me i cant run the code at the end u tell me to try and it is not working

    • @AmitChristian
      @AmitChristian  2 роки тому

      Are you getting any errors? Is it compiling the code correctly?

    • @atom2919
      @atom2919 2 роки тому

      @@AmitChristianno it just cant run it

    • @AmitChristian
      @AmitChristian  2 роки тому

      @@atom2919 can you share your source code

  • @tarakarajeswararao731
    @tarakarajeswararao731 3 роки тому

    iam not able to see the output in console but the programm is not having any errors

    • @AmitChristian
      @AmitChristian  3 роки тому

      Taraka, sorry to know that you are having issues with it. Did it create and executable file (.exe)?

    • @AmitChristian
      @AmitChristian  3 роки тому +1

      taraka rajeswararao, did it work?

    • @emanueleromano2633
      @emanueleromano2633 Рік тому

      @@AmitChristian i have the same problem, and it does create a new file, but no output sadly

    • @emanueleromano2633
      @emanueleromano2633 Рік тому

      okok, it work, basically, sometimes the antivirus will block the exe file making it unable to execute propely, so... deactivate the antivirus first and see how it work

  • @drivedownload7971
    @drivedownload7971 2 роки тому

    How to take input from the user ??

    • @AmitChristian
      @AmitChristian  2 роки тому

      Once you compile c code, it should be able to take an input. Does it not work ?

  • @jishankhan6686
    @jishankhan6686 3 роки тому

    I am not finding gcc.ex in bin..
    what can i do

    • @AmitChristian
      @AmitChristian  3 роки тому +1

      Jishan, it is possible that you may have downloaded and installed source code of MinGW. Look for mingw-get-setup.exe for downloading. Download it and launch the installer. Accept the terms and move on. If you still cannot find gcc.exe, please let me know.

    • @Mariajonnes
      @Mariajonnes 2 роки тому

      @@AmitChristian I've downloaded mingw-get-setup.exe but I still can't find it in the bin. Kindly assist me in this

    • @AmitChristian
      @AmitChristian  2 роки тому

      @@Mariajonnes Did you install the mingw setup file? It should install in C:\MinGW, and you should find BIN directory in that folder.

  • @nithinkumar6825
    @nithinkumar6825 2 роки тому

    i can't use graphics.h header file

  • @nithinkumar6825
    @nithinkumar6825 2 роки тому

    geting error

    • @AmitChristian
      @AmitChristian  2 роки тому +1

      Nothing, what error are you getting?

    • @nithinkumar6825
      @nithinkumar6825 2 роки тому +1

      ok working in NppExec script at if give a.exe it showing output in notepad
      console

    • @Birdboxed023
      @Birdboxed023 14 днів тому

      First things first thank you Chris Amit, this video is the best online to get notepadd++ up and running. For those of you that are getting this code error :"; about to start a child process: "a"
      CreateProcess() failed with error code 2: TRY THIS! AFTER following the video completely:
      1.Press Win key and type Control Panel
      2.Open Control Panel and click on System and security, System,and then Advanced System Settings.
      3Click on Enviormental Variables
      4. Under system Variables click NEW
      5.Enter Variable Name as : MinGW
      6.Value: C:\MinGW\bin
      7. Save and restart Notepad++
      Hope this helps

  • @AmitChristian
    @AmitChristian  3 роки тому

    ⚡ Hello Friends ⚡ hope you found this useful! Do Subscribe ♥ to my channel (ua-cam.com/channels/bU0jmMgFAfmL1J1BHsEmAA.html) for more videos.