• 0

Linking Notepad++ to run a compiler on F5?


Question

For college purposes, I need a quick, and light C IDE. Been using DevC++, since it's easy enough to create a new source file, enter code, and compile, without the need for creating projects, dependencies etc.

Problem with DevC++ is that the editor has some pretty bad highlighting and options. Notepad++ is miles ahead.

Now, I found that Notepad++ has options to run an external program, with arguments, when pressing F5, explained on the following link: http://notepad-plus.sourceforge.net/uk/run-HOWTO.php

Could anyone tell me how exactly to do that, and to which file? DevC++ is based on GCC, so it has gcc.exe in its root folder.

In lixux, the gcc syntax is, if I remember correctly:

gcc inputname.c -o outputname

Anyway, to sum it up, I would need the following: When you press F5, n++ calls GCC, and compiles and runs a new file, with its filename the same as the source code filename.

Thanx in advance :)

8 answers to this question

Recommended Posts

  • 0

yes it possible, but with plug-ins and mini plug-in script

see:

// The script code, C source code compiling with GNU CC (GCC) in notepad++ (by "NppExec" plug-in) and compressing with UPX...
//
// Enable? "//" signs remove in code line. 
// Sample: C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe "$(FULL_CURRENT_PATH)" -o $(NAME_PART)

YOUR_GCC\BIN\_PATH_HERE\gcc.exe "$(FULL_CURRENT_PATH)" -o $(NAME_PART)

// UPX Compress (with "--best, --ultra-brute" options)
// Enable? "//" signs remove in code line. 
// Sample: C:\WINDOWS\system32\upx.exe --best --ultra-brute $(NAME_PART).exe

YOUR_UPX_PATH_HERE\upx.exe --best --ultra-brute $(NAME_PART).exe

  • 0

I tried doing the post above to see if it worked and it seemed to compile fine, but it doesn't generate the .exe file within the folder with my sourcecode. I'm guessing the script needs some addition to copy it there.

  Punio4 said:
Problem with DevC++ is that the editor has some pretty bad highlighting and options. Notepad++ is miles ahead.

Now, I found that Notepad++ has options to run an external program, with arguments, when pressing F5, explained on the following link: http://notepad-plus.sourceforge.net/uk/run-HOWTO.php

Could anyone tell me how exactly to do that, and to which file? DevC++ is based on GCC, so it has gcc.exe in its root folder.

In lixux, the gcc syntax is, if I remember correctly:

gcc inputname.c -o outputname

Anyway, to sum it up, I would need the following: When you press F5, n++ calls GCC, and compiles and runs a new file, with its filename the same as the source code filename.

Thanx in advance :)

You can edit the highlighting of DevC++ although I do like Notepad++. You might want to give Code::Blocks a go. It's also a pretty lightweight IDE, and it has some customisation options for syntax highlighting also.

  • 0
  Dr_Asik said:
On my system, Visual Studio's cold start is about 3 seconds, while Code::Blocks takes above 5 seconds. Eclipse takes 15 :p . I wouldn't rule out VS on the sole basis that it's a large and powerful IDE. It's also very efficient.

Yeah I'll give you that, VS starts pretty quick on mine, although saying that Code::Blocks is around the same time. Feature-wise VS wins but I still like using CB / Dev C++ :p I think when I first started out and tried to do a few things in VS and it threw all this code at me before I could any of my own threw me a bit. Maybe I just tend to avoid it subconsciously now :laugh:

  • 0
  ViZioN said:
Yeah I'll give you that, VS starts pretty quick on mine, although saying that Code::Blocks is around the same time. Feature-wise VS wins but I still like using CB / Dev C++ :p I think when I first started out and tried to do a few things in VS and it threw all this code at me before I could any of my own threw me a bit. Maybe I just tend to avoid it subconsciously now :laugh:
I just redid my very informal test in which I count seconds out loud, watching the clock gadget, after lauching the program :

Visual Studio : 2.5 seconds

Code::Blocks : 3 seconds

Eclipse : 14 seconds

It's not very scientific :p but the results seem consistent. I wonder if there's an easy way to write a program that can reliably benchmark this? Anyway, my point was just to dispel the popular myth that open-source = much more efficient, because I've seen fully-fledged IDEs like DevC++ and Code::Blocks mentionned as "lightweight" alternatives, and I supposed VS was automatically cast aside based on that myth.

Of course I'm personally a big VS fan, the only reason I ever use anything else is if I'm working in Java or Python, or if I'm stuck on Linux for some homework. Oh and if you want your project to be empty : File -> New -> Project -> Visual C++ -> Empty Project. No code, not even a main.cpp. :)

  • 0
  Dr_Asik said:
On my system, Visual Studio's cold start is about 3 seconds, while Code::Blocks takes above 5 seconds. Eclipse takes 15 :p. I wouldn't rule out VS on the sole basis that it's a large and powerful IDE. It's also very efficient.

i agree. even though it's bloated, it's the best compiler out there and it's free (express edition)

  • 0
  Dr_Asik said:
Oh and if you want your project to be empty : File -> New -> Project -> Visual C++ -> Empty Project. No code, not even a main.cpp. :)

Yeah I think this was something I missed when I first started using VS :laugh: I'll give it another shot some time soon!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • PDF Shaper 15.2 by Razvan Serea PDF Shaper is a set of feature-rich PDF software that makes it simple to split, merge, watermark, sign, optimize, convert, encrypt and decrypt your PDF documents, also delete and move pages, extract text and images. The program is optimized for low CPU resource usage and operates in batch mode, allowing users to process multiple PDF files while doing other work on their computers. PDF Shaper is available in three editions - Free, Premium and Ultimate. Compare and pick edition which is suitable for you. Compatible with Windows 7, 8, 10, 11. Features: Extract text, images of other objects from single or multiple PDFs Convert PDF to Word RTF or image, or convert image to PDF Extract pages from PDF and save them as separate PDF files Combine several PDF files into single PDF Encrypt and decrypt PDF with password, set user permissions Rotate, crop and normalize pages, set meta data Add watermark or remove images from PDF Benefits: Easy-to-use, intuitive user interface Low CPU resource usage during any process, including conversion Free for personal use and for any non-commercial organization Supports Unicode characters Supports batch processing for any operation Small installation size PDF Shaper 15.2 changelog: Updated translations. Improved table positioning for better layout accuracy (DOC to PDF). Enhanced image resizing to more accurately reflect DPI settings (Image to PDF). Improved text positioning for consistent formatting (TXT to PDF). Optimized overall performance on 64-bit systems. Enhanced support for Unicode text documents. Fixed an issue where font settings were not applied correctly to text files Download: PDF Shaper 15.2 | 7.9 MB (Free for personal use only) Link: PDF Shaper Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I kind of do not engage much with people whose first retort is an ad hominem. Nevertheless the data is there.
    • I don't know if this is helpful or not, but just something I have an opinion on... Gaming PC builds where you've specced up the parts you want, built the system, colour matched things, etc... They may well be a labour of love, but on the 2nd hand market - nobody cares.  People are looking for deals, not your passion project
    • Firefox 139.0.4 fixes browser freezes, wallpaper bugs on Windows, and more by Taras Buria Mozilla is rolling out a new update for Firefox 139. Version 139.0.4 arrived today with four fixes and security patches. With today's release, Mozilla fixes freezes that occur when switching between apps or opening certain parts of the browser, issues with drop-down menus and triple-clicking text, and a bug with incorrect file names when setting a picture as the desktop background on Windows (the image would save as a BMP file with a blank name instead of Desktop Background.bmp) Here is the changelog: Security updates in Firefox 139.0.4 include two patches for vulnerabilities of high impact: CVE-2025-49709: Memory Corruption in canvas surfaces. Certain canvas operations could have led to memory corruption. CVE-2025-49710: Integer overflow in OrderedHashTable. An integer overflow was present in OrderedHashTable used by the JavaScript engine. As usual, you can update Firefox by heading to Menu > Help > About Firefox. Alternatively, grab the browser from the official website, Microsoft Store (if you are on Windows 10 and 11), or Neowin's Software page. For reference, release notes for version 139 and its subsequent bug-fixing update, 139.0.1, are available here and here. In other Firefox news, Mozilla recently announced the end of Pocket, Fakespot, and some other services. The company says its goal is to consolidate efforts and focus on Firefox development, its primary product.
  • Recent Achievements

    • Reacting Well
      Alan- earned a badge
      Reacting Well
    • Week One Done
      IAMFLUXX earned a badge
      Week One Done
    • One Month Later
      Æhund earned a badge
      One Month Later
    • One Month Later
      CoolRaoul earned a badge
      One Month Later
    • First Post
      Kurotama earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      494
    2. 2
      ATLien_0
      267
    3. 3
      +FloatingFatMan
      225
    4. 4
      +Edouard
      199
    5. 5
      snowy owl
      141
  • Tell a friend

    Love Neowin? Tell a friend!