in my project I would like to use the header on a raspberry pi zero. However, inside the header, this statement evaluates to false:
#if __cplusplus >= 201703L
I checked the value and it is indeed just at 201402L
g++ --version returns g++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110
and in my Makefile I specified:
CXXFLAGS := -std=c++17 -Wall
.
g++ -x c++ -std=c++17 -dM -E - </dev/null | less
lists the value for #define __cplusplus 201703L
So I quite don't understand, why the __cplusplus value is still at the value for c++14. Is there a way to update/change/set this macro?
Edit: My Makefile
SOURCES := $(shell find ./src -name '*.cpp')
CXXFLAGS := -std=c++17 -Wall
default:
$(CXX) $(CXXFLAGS) -O3 -pthread -o main $(SOURCES) -lpigpio -lrt
.PHONY: clean
clean:
rm main
Output, when I run make
g++ -std=c++17 -Wall -O3 -pthread -o main <all the cpp files here> -lpigpio -lrt