Makefile: USES= compiler:c++14-lang has no effect

I'm trying to port a new program over and I am getting the following error

Code:
/usr/local/include/google/protobuf/port_def.inc:210:1: error: static_assert failed due to requirement '201103L >= 201402L' "Protobuf only supports C++14 and newer."
static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and newer.");
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Even though I have the following in my Makefile:

Code:
USES=        autoreconf compiler:c++14-lang cpe gmake libtool localbase pkgconfig qt:5 shebangfix ssl

However, if I hard code in the following into the same port Makefile it works just fine:

Code:
CXXFLAGS="-std=c++14"

Isn't that suppose to be the same thing according to https://docs.freebsd.org/en/books/porters-handbook/book/#uses-compiler, or do I have it completely wrong?

I can see that my build output is showing that it's using C++11:

Code:
c++ -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -I./obj  -pthread -I/usr/local/include -I./leveldb/include -I./leveldb/helpers/memenv1 ....
 
You mix up the compiler version (e.g. g++-14) and language version (e.g. c++14).

You need to put this into the compiler commandline: -std=c++14. You don't need to change the compiler.
 
Back
Top