• 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

    • It's very pretty, IMO. I've always loved the Windows 7-style of UI design. 7 was the prettiest Windows ever. I'd love Microsoft to be THIS consistent and I'd love them to return to that.
    • Here are the Macs that support macOS 26 Tahoe by Taras Buria In addition to iOS 26, iPadOS 26, watchOS 26, and tvOS 26, Apple announced macOS 26 Tahoe, a new desktop operating system. Like the other operating systems made in Cupertino, macOS Tahoe features a redesigned UI with Liquid Glass, translucent icons, and other visual upgrades. There are also plenty of new features, such as a new Phone app for Mac, Live Activities on Mac, a massive Spotlight update, and a lot more. However, not all Mac owners will get to enjoy macOS 26. Like with iOS and iPadOS, Apple is dropping a few Macs with the release of macOS 26. You will be able to update to the new operating system if you own one of the following Apple computers. MacBook Air M1 and newer MacBook Pro M1 and newer MacBook Pro 13-inch 2020 (four Thunderbolt 3 ports) and newer MacBook Pro 16-inch 2019 iMac 2020 and newer Mac mini 2020 and newer Mac Studio 2022 and newer Mac Pro 2019 and newer Note that although Apple still supports Intel-based Macs, not all features will be available on systems that do not have Apple Silicon chips. Now-unsupported Macs that cannot upgrade from macOS Sequoia to macOS Tahoe are the following computers with Intel processors: Intel-based iMac 2019 Intel-based Mac mini 2018 iMac Pro Intel-based MacBook Air 2020 Intel-based MacBook Pro 2018 macOS 26 Tahoe is now available for developers to try in the beta program. Apple plans to launch the first public beta in July, alongside the release of public betas of iOS 26, iPadOS 26, and other operating systems that the company announced earlier today. You can find all the new features in macOS 26 Tahoe on the official Apple website.
    • I hope Microsoft goes back to the Fisher Price XP look first.
    • >It is a fundamental change to how macOS looks and feels, which some Neowin readers are definitely not a fan of. Hehe. You link to one of my posts here, but I actually LOVE glass effects and have spent the last decade or so hacking Windows to be more like Vista's Aero Glass, etc. Not sure why you thought my post implied I didn't like it. I was referring more to Apple copying this from Windows. I wish MS would being more glass/acrylic/mica to W11 ASAP! Maybe they will...by copying Apple this time.
    • iPad, Phone and Watch just updated. Downloading this now for my MBA
  • Recent Achievements

    • Rookie
      CHUNWEI went up a rank
      Rookie
    • Enthusiast
      the420kid went up a rank
      Enthusiast
    • Conversation Starter
      NeoToad777 earned a badge
      Conversation Starter
    • Week One Done
      VicByrd earned a badge
      Week One Done
    • Reacting Well
      NeoToad777 earned a badge
      Reacting Well
  • Popular Contributors

    1. 1
      +primortal
      477
    2. 2
      +FloatingFatMan
      272
    3. 3
      ATLien_0
      256
    4. 4
      Edouard
      203
    5. 5
      snowy owl
      191
  • Tell a friend

    Love Neowin? Tell a friend!