I am just starting to look at scons
I created a simple test.cpp
#include <iostream>
int main(int argc, char ** argv) {
std::cout << "Hello World\n";
return 0;
}
and gave it an SConstruct file
env = Environment()
env.Program(target='Hello', source=['test.cpp'])
and it compiles perfectly
g++ -o test.o -c test.cpp
g++ -o Hello test.o
Now, I shift the contents of this Sconstruct file to a SConscript file and enter the following into SConstruct
SConscript('SConscript', variant_dir='.build_release', duplicate=0, exports={'MODE':'release'})
SConscript('SConscript', variant_dir='.build_debug', duplicate=0, exports={'MODE':'debug'})
And scons selects GCC instead of g++
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: .build_release .build_debug
gcc -o .build_debug/Hello test.o
Undefined symbols for architecture x86_64:
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test.o
followed by a page and a half more of errors.
If I were to replace the gcc with g++ and run from the command line it works perfectly again.
Can anybody explain why it has changed from g++ to gcc and what I should do?