Run C++ within notepad++



  • Hello learned friends. I am called Ken.

    Iam running windows 10
    I have installed MinGW (Directory is C:\MinGW\bin).
    I have also installed notepad++ (directory is, C:\Program Files (x86)\Notepad++ )
    i have installed the NppExec plugin for Notepad++.

    i would like to run c++ code within notepad++ but i have failed.

    any one to help me out;

    i have tried to use the script below but it has failed.

    npp_save
    cd $(CURRENT_DIRECTORY)
    C:\MinGW\bin\g++
    cmd /c “$(CURRENT_DIRECTORY) \a.exe”



  • @kenn_ug

    You don’t provide any arguments to g++.exe, the command line even lacks the path to your source file. How should the compiler know what to do?

    Go figure out the required compiler options for your project and read thoroughly the documentation of NppExec, there you can find all information needed.



  • @dinkumoil

    kindly help me out. am trying but can’t figure it out



  • @kenn_ug said in Run C++ within notepad++:

    kindly help me out. am trying but can’t figure it out

    How would you do it from the command-line, without Notepad++? Ie, how would you compile the program if you used some other text editor for the source code, or had just downloaded it?

    This is not a compiler forum, or a programming forum. If you tell us how you would compile and run the program without Notepad++, we can help you translate that into how to do it inside Notepad++. But without that, you’re asking us why you cannot bake your cookies.



  • @kenn_ug said in Run C++ within notepad++:

    npp_save
    cd $(CURRENT_DIRECTORY)
    C:\MinGW\bin\g++
    cmd /c “$(CURRENT_DIRECTORY) \a.exe”

    Seems like you may just be missing the file to compile:

    npp_save
    cd $(CURRENT_DIRECTORY)
    C:\MinGW\bin\g++ "$(FULL_CURRENT_PATH)"
    cmd /c “$(CURRENT_DIRECTORY) \a.exe”
    

Log in to reply