0

I am writing c++ in notepad++ using nppexec plugin and compiling with minGW.

I have a folder structure of:

projckt/
- main.cpp
- head/
-- vtk.h
- src/
-- vtk/
--- vtkFile1.cpp
--- vtkFile2.cpp

How do I compile and link? For my "hello world" scripts I used:

npp_save
cd "$(CURRENT_DIRECTORY)"
g++ $(FILE_NAME) -std=c++11 -o $(NAME_PART)
NPP_RUN $(NAME_PART)

This works fine, I want a solution where I don't have to add a new .cpp file to the command when I create one. I have tried:

npp_save
cd "$(CURRENT_DIRECTORY)"
g++ *.cpp -std=c++11 -o $(NAME_PART)
NPP_RUN $(NAME_PART)

It seems that the .cpp files in the sub directories is not included. Is there a way similar to copying subtree folders in unix cp -r.

Malthe Eisum
  • 189
  • 11
  • You might use dedicated IDE to handle cpp workspace. – Jarod42 Sep 07 '17 at 12:22
  • Possible duplicate of [g++ compile source files existing in another directory](https://stackoverflow.com/questions/13639443/g-compile-source-files-existing-in-another-directory) – Andre Kampling Sep 07 '17 at 12:24
  • @Jarod42 I used Visual Studio 2017 but felt that I did to much in the back ground, I want to learn what happens in the background before I rely on a IDE – Malthe Eisum Sep 07 '17 at 12:25
  • @AndreKampling How do I impliment this in notepad++ with nppexec on windows – Malthe Eisum Sep 07 '17 at 12:35
  • 2
    @MaltheEisum: Using makefiles see [wikipedia](https://en.wikipedia.org/wiki/Makefile) and [how to make a simple makefile](https://stackoverflow.com/questions/2481269/how-to-make-a-simple-c-makefile). – Andre Kampling Sep 07 '17 at 12:38

0 Answers0