diff --git a/.gitignore b/.gitignore index b25ec6d..adb255b 100644 --- a/.gitignore +++ b/.gitignore @@ -250,3 +250,37 @@ dist # Ignore generated credentials from google-github-actions/auth gha-creds-*.json + +# C++ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app diff --git a/c++/learning/Makefile b/c++/learning/Makefile new file mode 100644 index 0000000..efc4dd3 --- /dev/null +++ b/c++/learning/Makefile @@ -0,0 +1,18 @@ +CXX = g++ +CXXFLAGS = -g -Wall +TARGET = main.out +SRC = $(wildcard *.cpp) +OBJ = $(SRC:.cpp=.o) + +all: $(TARGET) + +# Build target +$(TARGET): $(OBJ) + $(CXX) $(CXXFLAGS) $(OBJ) -o $(TARGET) + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $< -o $@ + +# Clean target +clean: + rm -f $(TARGET) $(OBJ) diff --git a/c++/learning/README.md b/c++/learning/README.md new file mode 100644 index 0000000..f91ef58 --- /dev/null +++ b/c++/learning/README.md @@ -0,0 +1,22 @@ +# C++ + +Various sample C++ applications showing C++ lang structure, concepts, sample libraries usage build, dependency management etc. + +## Prerequisites + +C++ compiler + +```bash +# for Ubuntu +sudo apt -y install build-essential +``` + +## Building from code + +```bash +# to build application +make + +# to remove intermediate build files and compiled application +make clean +``` diff --git a/c++/learning/main.cpp b/c++/learning/main.cpp new file mode 100644 index 0000000..1c17761 --- /dev/null +++ b/c++/learning/main.cpp @@ -0,0 +1,7 @@ +#include +using namespace std; + +int main() { + cout << "Hello, World!" << endl; + return 0; +}