• 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

    • Helpwire doesn't support sound transfer.
    • Here's your first look at Raycast for Windows, now in beta by David Uzondu Last September, we reported that Raycast, the popular macOS command bar and launcher tool, was set to make its way to Windows in 2025. Since its launch in 2020, Raycast has quickly become the go-to app that people recommend for new Mac users due to its speed, UI, features, and plethora of extensions. People have been begging for a Windows build, and even a Linux one, for a long time. Now, the company has published a YouTube video showcasing the beta on a Microsoft Surface and explaining how you can get your hands on it today. It's all opened by pressing the default hotkey (Alt + Space). This gives you a central command bar to launch apps, run commands, and search for files. You get a lot of the core features right now, like a calculator that handles natural language queries, a full clipboard history manager, and tools for creating text snippets and quicklinks. For example, typing .pdf instantly filters for just PDF documents, and using a forward slash lets you navigate through folder paths directly. Once you find a file, pressing Ctrl + K opens a contextual action menu with options like "Show in File Explorer" or "Copy File." The included calculator is also a powerhouse, handling everything from basic math to natural language queries, like "time in Barcelona" or "days until August 12." The full clipboard history manager is a massive upgrade over the Windows default. It keeps a running log of everything you copy to your clipboard, including blocks of text, links, images, and files. You can open the clipboard history and search through every item you've copied. It also comes with a powerful filtering system. By pressing Ctrl + P, you can filter your history to show only text, images, links, or even just colors. Its Quick AI feature is also included and will be free for everyone during the beta period. That means you can ask it questions and get answers without needing a Pro subscription for now. Quick AI is built on a set of AI models, like GPT-4o mini, which maintains conversational context, allowing for natural follow-up questions, and you can browse your entire chat history. There's also an "AI search" feature, which is listed as coming soon. The most surprising part is the support for third-party extensions right out of the gate. Raycast built its reputation on an extensive library of integrations that connect it to services like Slack, YouTube, and GitHub. While some of these extensions are written for specific macOS features and are not compatible, many of the extensions are written in JavaScript, which means a huge number of them already work from day one on Windows. Image: @alvaniss1g on X As you can guess, the beta is not feature-complete. A lot of the heavy-hitting Pro features are still on the roadmap and are promised to be coming soon. This includes Cloud Sync to keep your settings consistent across machines, as well as the much-loved Raycast Notes feature. If you are a Pro user on Mac looking to switch, you may want to wait a little longer for full parity. Snippet expansion and calendar integration are also on the to-do list for future updates. Getting into the beta is a bit of a process. Access is being managed through a gradual rollout, with priority given to users who signed up for the waitlist announced last year. If you are on the list, you can expect to receive an email soon. And if you don't like the waitlist, your best bet is to find a friend who already has an invite code, as each invited user gets a few extra codes to share. Sorry, Linux users, but there is no word on your build at the moment, and we're not holding our breath.
    • We M$ and our 801 loved partner$ are having a data party !
    • Wise Disk Cleaner 11.2.4 by Razvan Serea Wise Disk Cleaner is a free disk utility designed to help you keep your disk clean by deleting any unnecessary files. Usually, these unnecessary, or junk files appear as a result of program's incomplete uninstalls, or Temporary Internet Files. It is best if these files are wiped out from time to time, since they may, at some point, use a considerable amount of space on your drives. Wise Disk Cleaner, with its intuitive and easy to use interface, helps you quickly wipe out all the junk files. Using the program is indeed easy. It also works fast when both scanning for files and deleting files. The new Wise Disk Cleaner has more advantages: improved performance, better interface and scans/cleans more thoroughly. Wise Disk Cleaner Free provides lifetime free update service and Unlimited Free technical support. The first Slimming System software Wise Disk Cleaner is the first system slimming tool, which will help you to remove Windows useless files that you don't need, such as Korean IME, Windows Sample music, videos, pictures, Installers and Uninstallers of Updates Patches etc. Wise Disk Cleaner 11.2.4 Build 844 changelog: Improved cleaning rules for WPS Office and Mozilla Firefox. Added cleaning support for Jetbrains Pycharm, Jetbrains WebStorm, Jitsi, Visual Studio Code, jv16 PowerTools, Kakao Talk, Kingo Root, Launchy, Layers of Fear, LBRY, League of Legends, Leapfrog Connect, and Leawo Prof Media. Fixed minor bugs from the previous version. Download: Wise Disk Cleaner 11.2.4 | 6.9 MB (Freeware) Download: Portable Wise Disk Cleaner 11.2.4 | 7.3 MB View: Wise Disk Cleaner Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Hi everyone! I’m looking for some help. I’m using HelpWire for remote support, and while everything else works fine, I’m not getting any sound from the remote computer. Is there a setting I might be missing? Any tips would be appreciated. Thanks in advance!
  • Recent Achievements

    • Conversation Starter
      Kavin25 earned a badge
      Conversation Starter
    • One Month Later
      Leonard grant earned a badge
      One Month Later
    • Week One Done
      pcdoctorsnet earned a badge
      Week One Done
    • Rising Star
      Phillip0web went up a rank
      Rising Star
    • One Month Later
      Epaminombas earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      537
    2. 2
      ATLien_0
      205
    3. 3
      +FloatingFatMan
      167
    4. 4
      Michael Scrip
      151
    5. 5
      Som
      127
  • Tell a friend

    Love Neowin? Tell a friend!