c++ - Compiling with clang with c++11 enabled fails -


having following test.cpp:

#include <iostream> int main() {         int a{};         std::cout << "test" << std::endl; } 

when build latest gcc (4.8.0) g++ test.cpp -std=c++11 (gcc fails), file compiles. trying compile latest clang

clang version 3.4 (trunk 182322) target: x86_64-apple-darwin12.3.0 thread model: posix 

the build fails:

clang test.cpp -std=c++11   undefined symbols architecture x86_64:   "std::ostream::operator<<(std::ostream& (*)(std::ostream&))", referenced from:       _main in test-ncubkf.o   "std::ios_base::init::init()", referenced from:       ___cxx_global_var_init in test-ncubkf.o   "std::ios_base::init::~init()", referenced from:       ___cxx_global_var_init in test-ncubkf.o   "std::cout", referenced from:       _main in test-ncubkf.o   "std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:       _main in test-ncubkf.o   "std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:       _main in test-ncubkf.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) 

what can done clang (or gcc) work in c++11 mode?

clang c. c++, use clang++.

clang++ test.cpp -std=c++11 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -