hello there. i've installed mingw compiler and im wondering how i would go about setting up notepad++ to compile my c/c++ code?. How do i do this?
-regards.
Short, practical clarification and a small ready-to-use NppExec workflow for the OP () and later posters. Two realistic choices are shown: keep Notepad++ as a lightweight editor and call an external compiler, or use a full IDE (Code::Blocks) if you want an out‑of‑the‑box compiler + debugger. was right to point at NppExec for work inside Notepad++; was also right that Code::Blocks bundles a compiler/debugger for an easier start. (d0vgan.github.io)
Minimal NppExec script (save in Plugins → NppExec → Execute, then add it to the menu via Advanced Options). Edit the g++ path if you did not add MinGW/MSYS2 to your PATH:
NPP_SAVE
cd "$(CURRENT_DIRECTORY)"
"C:\path\to\g++.exe" -std=c++17 -Wall -Wextra -g -o "$(NAME_PART).exe" "$(FILE_NAME)"
NPP_RUN "$(NAME_PART).exe" Notes: replace the compiler path with your actual g++ if it is not globally available; the variables like $(FULL_CURRENT_PATH), $(CURRENT_DIRECTORY), $(FILE_NAME) and $(NAME_PART) are provided by Notepad++/NppExec so the script works across files. To keep output inside Notepad++ use the NppExec console; to run the program in a separate window use NPP_RUN or a cmd /C start /wait trick. (d0vgan.github.io)
Troubleshooting tips:
g++ --version (if it fails, add MinGW/MSYS2 bin to PATH or use the absolute path in the script).If the goal is learning/quick edits, Notepad++ + NppExec is fine. If you want integrated build configurations, GUI debugger, project management, pick Code::Blocks or another IDE. and others asking about the Run option: the Run menu is useful for single-line commands, but NppExec gives a more reliable scripting workflow inside Notepad++. (npp-user-manual.org)
Jump to Post— tux4life 2,072hello there. i've installed mingw compiler and im wondering how i would go about setting up notepad++ to compile my c/c++ code?. How do i do this?
-regards.
I assume that the g++ command is in your PATH and that your environment variables are set correctly.
Then follow these …
Jump to Post— tux4life 2,072Please don't mind reading my previous post, just read this article:
:P
Jump to Post— Ancient Dragon 5,243Why would you want to do that? Just use Code::Blocks and you have it done, and probably much better too. And Code::Blocks contains a debugger, which Notepad++ does not.
Jump to Post— Member #248612Some people use to eat their soup with a fork.......
hello there. i've installed mingw compiler and im wondering how i would go about setting up notepad++ to compile my c/c++ code?. How do i do this?
-regards.
I assume that the g++ command is in your PATH and that your environment variables are set correctly.
Then follow these steps:
g++ -o %1 %2
PAUSE Let's say that the path to your batch file is: C:\compile.bat , then after putting quotes around it it becomes [B]"[/B]C:\compile.bat[B]"[/B] , after that you type the name you want to give to your executable file, for instance myprogram.exe, and thereafter (seperate those two with a space) you type the name of your C++ source file, for example: mysrc.cpp, the whole line would then be:
[B]"C:\compile.bat" [I]myprogram.exe[/I] [I]mysrc.cpp[/I][/B] Hope this helps :)
Please don't mind reading my previous post, just read this article:
:P
Why would you want to do that? Just use Code::Blocks and you have it done, and probably much better too. And Code::Blocks contains a debugger, which Notepad++ does not.
hmm...i was hoping to just edit text files without getting into major IDE's.
Some people use to eat their soup with a fork.......
please how do i use notepad to compile my c++ codes with codeblocks
You don't. Notepad is just a text editor, not a compiler. Code::Blocks is distributed with a greate compiler. when you download CB get the distribution that contains MinGW compiler.
Thanks but how do i use the run option in notepad++ when writing c++ codes
What did the NotePad's HELP say about the RUN option.
. . . Code::Blocks is distributed with a greate compiler. when you download CB get the distribution that contains MinGW compiler.
Not to hijack the thread (though the OP hasn't posted here since 2009), but I am presently looking around for a free C++ IDE/compiler myself. Would you recommend Code::Blocks over Visual C++ 2010 Express, or even something else?
: If you are using Code::Blocks why would you want to use Notepad++? Doesn't make any sense.
Not to hijack the thread (though the OP hasn't posted here since 2009), but I am presently looking around for a free C++ IDE/compiler myself. Would you recommend Code::Blocks over Visual C++ 2010 Express, or even something else?
Use Code::Blocks if you want to write portable programs -- its supported on MS-Windows, *nix and MAC. VC++ 2010 is only for MS-Windows, but is the easiest to write MS-Windows programs with any or a combination of several .net languages.
Ok. thanks
just thought i could compile with codeblocks on notepad++
Code::Blocks is not a compiler, its an IDE very much like notepad++.
FWIW the Zeus Lite editor can run an external compiler and capture the compiler error output.
Just edit the c/c++ document type and add the compiler command line to the compiler panel.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.