Using scons to compile c++ file with -std=c++11 flag -
i trying compile c++ file -std=c=+11 option using scons.
file : test.cc
#include <unordered_map> int foo() { return 0; }
file : sconstruct
env = environment() env.append(cxxflags = '-std=c++11') #print env['cxxflags'] src_files = split('test.cc') lib_name = 'test' library(lib_name, src_files)
i getting following error. seems cxxflags not taking effect when g++ invoked:
g++ -o test.o -c test.cc in file included /usr/include/c++/4.8.2/unordered_map:35:0, test.cc:2: /usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error file requires compiler , library support iso c++ 2011 standard. support experimental, , must enabled -std=c++11 or -std=gnu++11 compiler options. #error file requires compiler , library support \ ^ scons: *** [test.o] error 1
i have read few postings compiling c++ files -std=c++11 option modifying "construction environment", feel have done. can please help.
thank you, ahmed.
use env.library
instead of library
build library construction environment.
env = environment() env.append(cxxflags = '-std=c++11') src_files = split('test.cc') lib_name = 'test' env.library(lib_name, src_files)
Comments
Post a Comment