This code does not belong to me. Please see: https://www.geeksforgeeks.org/ml-neural-network-implementation-in-c-from-scratch/ The compilation line on my architecure is g++ -I /usr/local/include/eigen3 main.cpp NeuralNetwork.cpp -std=c++11 -o main && ./main Make sure to update your gcc and have Eigen3 installed on your machine.