Compile and run C code using Notepad++ (2021)

preview_player
Показать описание
For compiling and running using MinGW:
--- UPDATE --- :
The following script will also prevent running the program if compilation is not successful.

npp_save
cd "$(CURRENT_DIRECTORY)"
cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe"

--- THE SCRIPT SHOWN IN THE VIDEO ---
npp_save
cd "$(CURRENT_DIRECTORY)"
gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)"
"$(NAME_PART).exe"

For compiling and running using Visual C:
--- UPDATE --- :
The following script will also prevent running the program if compilation is not successful.

npp_save
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"

--- THE SCRIPT SHOWN IN THE VIDEO ---
npp_save
cd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
cd $(CURRENT_DIRECTORY)
"$(NAME_PART).exe"

More info on Visual C scripts:

Рекомендации по теме
Комментарии
Автор

Thank you for the videos CodeVault; I'm currently taking a class in Operating Systems and I need to learn a lot in C. Your videos help a lot <3

docxy
Автор

I am learning C, and start using Notepad++ as a text editor as an author mentioned in his beginning C book that I am reading. At first, I didn't see the real power of Notepad++ until I learnt that I could do splitting screens and other stuff like hiding coding lines... while editing my source code. And now, with Notepad++, I am able to add on an optional feature / plugin that will allow me to compile and execute all my C programs from within my Notepad++ editing! All such things really mean Notepad++ is even more powerful and greater. And now I am learning that I could even choose different compilers (minGW, VC, ..) in my scripting setups! What can I say? Thank you so much for such a great video.

tthai
Автор

Hi nerds :)
im trying to learn the basics ( compile + coding ) its really hard
big respect for all the nerds around the world

samfisher
Автор

Many people learn C (i guess) because they want to make a game or even a emulator (like CHIP8) in SDL (or OpenGL) or to make a usable program in GTK, well i'm one of them, i will like to put to a good use what i learn and learn more, this is a good idea for more videos

goldhalowings
Автор

Thanks. The .exe extension for the output file didn't work for me so I got rid of it and things started working. Just another hint for those who aren't English speaking natives, go to settings, new document, change the encoding to either ansi (the first ticking option) or to windows-1252 (in the bottom dropdown), in your new file include locale.h and use the setlocale in Main.

luisdominguesforprogramaca
Автор

Hey I tried getting onop (minGW. org) but the domain has expired, there i another one at (sourceforge. net) But I just whant to be sure that there are others that have experience with this website before going and downloading from there. and there is sure to be others that think the same, thanks for anny responds.
And thanks for helping out with notepad ++

Platinumcan
Автор

hey dude I am sorry I did not reply to you earlier but this is the problem exactly:
So the problem is with files taking some input, the code is let's say :
#include<stdio.h>
int main()
{
int d ;
printf("Enter age.");
scanf("%d", &d);
printf("%d", d);
return 0;
}

Now when I run this in the nppexec console following all your instructions, nothing happens, there is just a cursor blinking, so I type something on the keyboard(say 2) and press enter, then it prints :

Enter age.2

Why is it not printing the prompt first and then taking input ?

In case multiple inputs in the code, what it does is that it takes all the inputs first, then prints the prompt printf statements, skips the scanf statements and gives the output .

mb
Автор

Thank you bro very much it worked man, 😀

tapanpatel
Автор

Thank you so much. Now I can compile and run my Fortran files and run them in Notepad++. Thank you!!

oscaralvarez
Автор

Sir, Please explain me how to run POSIX thread programs from notepad++.waiting for your explanation.

aketisubbu
Автор

if we design a custom program (similar to arduino ide) using visual studio, could we make it compile and upload the codes to an MCU and how?
I would highly appreciate your efforts if you make a tutorial on this.

manofmesopotamia
Автор

thanks for video, it 's help full. Now i can compile C in notepad++ that 's wondenful

phungphamvan
Автор

@CodeVault good evening, I would like to know from you with greater clarity; given my little programming experience, what use this script is, summing up in a few words.
npp_save
cd "$(CURRENT_DIRECTORY)"
cmd /c gcc -o "$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && "$(NAME_PART).exe

EnricoPanebianco
Автор

Hi, i have run into a problem here. This runs okay for all C code, except the ones asking for input. It waits for a prompt, and after the prompt is given, it assumes the prompt as input and skips the actual scanf() code that should be asking for input.

I would be grateful if you find out what's wrong.

mb
Автор

Sir, I want to include graphics header file for C in Notepad++... Please tell me how???

arunkumarc
Автор

my script runs in cmd and closes at same time, I can't see the output

smitpatel
Автор

CodeVault, I currently can't test the script that uses the Visual Studio Community in my PC yet (that is for the future.) However, when I looked into your updated script (the updated version of Visual Studio community) above, I notice there is a "2019" in the path of the cd (change directory) command. I am wondering if you can change that "2019" to something more generalized, that will help the script still to be working in the far more future when Microsoft releases newer versions (like 2020, 2021, ...) to the public. Will something like this "cd $(CURRENT_DIRECTORY)" work? Thanks again. Great!

tthai
Автор

by both ways i could see below error


; about to start a child process: ""new1.exe""
CreateProcess() failed with error code 2:
The system cannot find the file specified.

MechMonty
Автор

Hi!! I am using the Notepad ++ text editor but it does not recognize the "src" and "url" in the
@ font-face of the css code to import custom fonts. What can I do to solve this problem?

djangonunez
Автор

maybe next time show your full screen. I don't know how you got your system properties menu.

zabiarayyan