"enable_if_t" not a type gcc 8.3.1

301 views Asked by At

System specifications: Centos 7 with devtoolset-8 enabled (gcc 8.3.1), cmake 3.14.6

I seem to have an error regarding gcc versioning causing a 'type error'

I am trying to build a gitlab project (https://github.com/ColinKennedy/USD-Cookbook/tree/master/plugins/custom_resolver) which needs a built version of Pixar's USD. I've already successfully built USD and run the following commands to build the custom resolver project and provide it the location of USD:

scl enable devtoolset-8 bash

USD_INSTALL_ROOT=/home/fernandos/Documents/USD cmake ..

make install

however during make install this error pops up:

/home/fernandos/Documents/USD/include/pxr/base/tf/hash.h:44:6: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
 std::enable_if_t<std::is_integral<T>::value>

This type error seems to indicate an error possibly caused by a wrong version of gcc if I look at other stack overflow posts. I know that enable_if_t was added in c++14, so if you have an old compiler (such as the standard gcc 4.8.1 on Centos 7) it would throw this error as it standard uses c++11 to compile. However, I'm using the devtoolset-8 environment and everything seems to indicate that I am using gcc 8.3.1 to compile (I even make the MakeFile print the version out). So, how is it possible that I get this error, does gcc 8.3.1 not know this type?

I also noticed that the error originates from my USD build: I am not sure if this matters, but I built it with gcc 6.3.1 (which certainly knows the enable_if_t type). As I am relatively new to building on linux with cmake/make could this cause problems?

0

There are 0 answers