Project

General

Profile

Bug #719

Unrecognized Command Line Option "-std=gnu++0x" With Gmake on FreeBSD

Added by Daniel Curtis almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Command-Line Help
Target version:
Start date:
01/10/2016
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

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'
      
  • 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
    
NOTE: To use the GCC compiler permanently, edit the 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
    

Resources

History

#1 Updated by Daniel Curtis almost 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Daniel Curtis over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF