• 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

    • Microsoft has some PC VR games that could be played with it.
    • As such, many developers will start dropping Windows 10 support in their products Hi! Actual developer here. No we won't. It really doesn't work that way simply because most Windows devs don't target to a specific release of Windows unless we're using a feature that only exists IN a specific version, and that's pretty unusual. The biggest example would be MSFT killing off Windows Mixed Reality in Win 11, but most stuff we write for Win 10 will just work fine in Win 11 and vice versa. The vast majority of software doesn't rely on these things and will continue working on any recent version of Windows. Heck some of my software still runs on WinXP. Where Win 10 users will be left behind is software that relies on new features in Win 11 but again, we tend not to use those unless we're writing specific apps that need those features. In fact, the biggest danger area isn't apps, it's drivers as hardware makers focus on new machines more than supporting legacy devices.
    • Google Chrome finally lets you change the position of the address bar on Android by Aditya Tiwari Google is rolling out a small but useful update to Chrome. The update makes the address bar in the web browser more customizable and accessible. You can now place it at the top or bottom of the screen, as you prefer. The ability to change the position of the address bar in Google Chrome has started rolling out and will be available to all users over the coming weeks. You can long-press on the address bar and select the "Move address bar to bottom" option. Alternatively, you can also go to Settings > Address bar to customize it. "Depending on the size of your hand and your device, one address bar position may feel more comfortable than the other," the company said in a blog post. "We designed this update to give you the flexibility to choose your preferred location — so you can browse with more ease." The address bar is where you can type website names you want to visit. It's a crucial part of our browsing experience and also doubles as the search bar in Google Chrome. The browser's Android version has been around since 2012, and the address bar's top position has remained the default for most of its time. Over the years, Google has enhanced the address bar with additional features, such as the ability to automatically hide when scrolling up on a web page, thereby offering more screen real estate. A bottom-mounted address bar could be a better option for users with small hands or those who prefer to use their device with one hand. Interestingly, this is not the first time Chrome has had a bottom address bar, as Google briefly experimented with the feature in the past. The bottom address bar even made its way to Chrome for iOS, where you can long-press the address bar to toggle between the two options or change it in the settings. It's hard to digest that it took Google so long to add a simple feature. The defunct Windows Phone had this feature as far back as 2012, and Chrome's rival Safari added a Bottom layout option in 2021. Nonetheless, the latest update brings Chrome in line with other browsers that offer a bottom address bar on Android.
    • That's just my understanding of the courts situation with the law with of AI and when could be copyrighted. Found this article about how different area's of the world are handling copyrights - https://www.cooley.com/news/in...uts-varies-around-the-world AI seems to be a disruptive technology so far, like the internet was. Whenever a disruptive tech comes out, it takes a while on what societies accepts, adapts, rejects, and how it ultimately pans out.
  • Recent Achievements

    • Week One Done
      DrRonSr earned a badge
      Week One Done
    • Week One Done
      Sharon dixon earned a badge
      Week One Done
    • Dedicated
      Parallax Abstraction earned a badge
      Dedicated
    • First Post
      956400 earned a badge
      First Post
    • Week One Done
      davidfegan earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      616
    2. 2
      ATLien_0
      227
    3. 3
      +FloatingFatMan
      170
    4. 4
      Michael Scrip
      166
    5. 5
      Som
      148
  • Tell a friend

    Love Neowin? Tell a friend!