i am a beginner using eclipse CDT. usually in DEVc++ or other lightweight IDE\'s we can directly open and edit a single .cpp file from desktop and run it.
on the other h
Create a Makefile
project File->New->C++ Project->Makefile project->Empty project->Linux GCC
.
Then create a Makefile
for your project and add the following lines:
CXXFLAGS := -std=c++14 -Wall -Wextra -pedantic-errors
SOURCES := $(wildcard *.cpp)
PROGRAMS := $(patsubst %.cpp,%,$(SOURCES))
all: $(PROGRAMS)
clean:
$(RM) $(PROGRAMS)
Note: the indentation of the command after clean:
is using a TAB
(spaces will not work).
That will compile any source file in the project directory that ends in .cpp
.
Then select Outline View
window. Select and add all
and clean
as targets. Then open the Build Targets
window to compile or clean your project.