2

I have both options on in my Makefile, Basically, my Make file looks like this

$OPT_FLAG := -O2 -std=c++11 $CXXFLAG += $(OPT_FLAG) -std=c++14 

so actual build command is sth like

g++ -m64 ... -std=c++11, -std=c++14 ... 

and of course $CXXFLAG is passed as argument to invoke gcc build. In this case, am I using c++14 or c++11? my gcc version is 5.4

4
  • 3
    IIRC it is the rightmost option that is chosen. Trying to find a dupe target Commented Feb 10, 2020 at 19:34
  • stackoverflow.com/questions/15909788/… Commented Feb 10, 2020 at 19:35
  • i added another duplicate, it is about -Ox but still I thought it is related enough to add it Commented Feb 10, 2020 at 19:37
  • 2
    Is there more to this than checking what __cplusplus is, and checking if it's consistent depending on the order you pass? Commented Feb 10, 2020 at 19:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.