Bug #719
Unrecognized Command Line Option "-std=gnu++0x" With Gmake on FreeBSD
Description
I recently tried to install a NodeJS web application and came across an error that prevented the installation to work.
- Istarted the build process:
npm install
- Then the error came up, stating:
gmake: Entering directory '/usr/home/ff-accounts/fxa-auth-server/node_modules/scrypt-hash/build' CC(target) Release/obj.target/scrypt/crypto_scrypt-sse.o CXX(target) Release/obj.target/scrypt/node_scrypt.o cc1plus: error: unrecognized command line option "-std=gnu++0x" scrypt.target.mk:97: recipe for target 'Release/obj.target/scrypt/node_scrypt.o' failed gmake: *** [Release/obj.target/scrypt/node_scrypt.o] Error 1 gmake: Leaving directory '/usr/home/ff-accounts/fxa-auth-server/node_modules/scrypt-hash/build'
- Then the error came up, stating:
- It turns out I needed to install GCC:
pkg install gcc48
- And then set the CC, CXX, and CPP environment variables to use GCC instead of Clang:
export CC=gcc48 export CXX=g++48 export CPP=cpp48
- Then restart the npm install process:
npm install
make.conf
file:vi /etc/make.conf
- And add the following:
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc48) CC=gcc48 CXX=g++48 CPP=cpp48 .endif