<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Run C++ without compiling]]></title><description><![CDATA[<p dir="auto">Can I run C++ without compiling? Every time I run some code I end up with an exe file.</p>
<p dir="auto">I have set up MinGW-w64 to run from the Macro Menu and it works ok, except that there is no out put displayed in the consol. How can I display the results of my code in the consol?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26097/run-c-without-compiling</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 04:15:01 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26097.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Sep 2024 22:26:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Run C++ without compiling on Tue, 10 Sep 2024 16:31:53 GMT]]></title><description><![CDATA[<p dir="auto">The directory will change automatically after clicking on NppExec’s “Follow $(CURRENT_DIRECTORY)” option (<em>which I thought was enabled by default – sorry</em>):</p>
<p dir="auto"><img src="/assets/uploads/files/1725985689243-screenshot-2024-09-10-121533.png" alt="Screenshot 2024-09-10 121533.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/96514</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96514</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Tue, 10 Sep 2024 16:31:53 GMT</pubDate></item><item><title><![CDATA[Reply to Run C++ without compiling on Tue, 10 Sep 2024 13:06:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/24325">@rdipardo</a> said,</p>
<blockquote>
<pre><code>cmd /c g++ $(FULL_CURRENT_PATH) -o $(NAME_PART) &amp; .\$(NAME_PART)
</code></pre>
</blockquote>
<p dir="auto">That assumes that NppExec’s current working directory is the same as the active file.  And that the active file’s full current path has no spaces.  Both are dangerous assumptions, in my opinion.</p>
<p dir="auto">I would use <strong>Plugins &gt; NppExec &gt; Execute NppExec Script…</strong>, and create (and save) the script:</p>
<pre><code>npp_save
cd "$(CURRENT_DIRECTORY)"
g++ "$(FILE_NAME)" -o "$(NAME_PART)"
cmd.exe /c "$(NAME_PART)"
</code></pre>
<p dir="auto">… this will save the active file (to make sure you’re always running the most recent), change into the active file’s directory (because we cannot know what directory NppExec currently thinks of as “active”, so if you’ve run other scripts recently, it might not be where you think it is), build the executable out of it, and then run that executable in the NppExec console panel inside Notepad++.  By using the quotes surrounding the directory and file names, it makes sure that it will handle spaces in the path or filename correctly.</p>
<p dir="auto">If it were something I did often, I’d also use NppExec’s <strong>Advanced Options…</strong> dialog to put that script into the menu, and then (after restarting Notepad++) use <strong>Settings &gt; Shortcut Mapper</strong> to assign a keyboard shortcut.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96512</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96512</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 10 Sep 2024 13:06:24 GMT</pubDate></item><item><title><![CDATA[Reply to Run C++ without compiling on Tue, 10 Sep 2024 01:10:27 GMT]]></title><description><![CDATA[<p dir="auto"><strong>P.P.S</strong> Not to leave out Notepad++, you could also just install the <a href="https://github.com/d0vgan/nppexec#readme" rel="nofollow ugc">NppExec</a> plugin.</p>
<p dir="auto">Assuming your MinGW toolchain is in the <code>PATH</code>, just open the NppExec console and run this:</p>
<pre><code class="language-text">cmd /c g++ $(FULL_CURRENT_PATH) -o $(NAME_PART) &amp; .\$(NAME_PART)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/96506</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96506</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Tue, 10 Sep 2024 01:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Run C++ without compiling on Tue, 10 Sep 2024 00:34:45 GMT]]></title><description><![CDATA[<p dir="auto"><strong>P.S.</strong> You can skip the Embarcadero website and download Dev-C++ from GitHub without signing up for anything: <a href="https://github.com/Embarcadero/Dev-Cpp/releases" rel="nofollow ugc">https://github.com/Embarcadero/Dev-Cpp/releases</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/96504</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96504</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Tue, 10 Sep 2024 00:34:45 GMT</pubDate></item><item><title><![CDATA[Reply to Run C++ without compiling on Tue, 10 Sep 2024 00:28:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/28008">@John-Douglas</a> said in <a href="/post/96501">Run C++ without compiling</a>:</p>
<blockquote>
<p dir="auto">How can I display the results of my code in the consol?</p>
</blockquote>
<p dir="auto"><a href="https://www.embarcadero.com/free-tools/dev-cpp" rel="nofollow ugc">Dev-C++</a> has a “Build and Run” command, with output going directly to a built-in console window. I believe Eclipse can do something similar with the <a href="https://projects.eclipse.org/projects/tools.cdt" rel="nofollow ugc">CDT plugin</a> installed.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96503</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96503</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Tue, 10 Sep 2024 00:28:47 GMT</pubDate></item><item><title><![CDATA[Reply to Run C++ without compiling on Mon, 09 Sep 2024 23:57:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/28008">@John-Douglas</a> said in <a href="/post/96501">Run C++ without compiling</a>:</p>
<blockquote>
<p dir="auto">Can I run C++ without compiling? Every time I run some code I end up with an exe file.</p>
<p dir="auto">I have set up MinGW-w64 to run from the Macro Menu and it works ok, except that there is no out put displayed in the consol. How can I display the results of my code in the consol?</p>
</blockquote>
<p dir="auto">What you want would be an interpreter, rather than a compiler.</p>
<p dir="auto">I looked a bit, but I could not find any C++ interpreters that run on Windows and have binaries already built and ready to install. You can <a href="https://www.google.com/search?q=%22C%2B%2B%22+%22interpreter%22+%22windows%22" rel="nofollow ugc">search</a> and see if you can make out anything that’s within your ability to set up. It all looked absurdly complicated to me.</p>
<p dir="auto">My advice is that unless you have a really good reason for doing what you’re trying to do, either scrap the idea of running your code from Notepad++ and just use MS Visual Studio to write, compile, execute and debug C++ code; or else forget about C++ and use a language that’s designed to be interpreted, like Python.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/96502</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/96502</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 09 Sep 2024 23:57:45 GMT</pubDate></item></channel></rss>