摘自stackoverflow.com
1.The error isn't that it's the wrong architecture, it's that std::cout
(and
other symbols) isn't defined.
You should compile and link with g++
not gcc
,
to automatically link with correct C++ libraries.
2.The error is caused because you're compiling with gcc
,
which only default-links libc
.
You need to compile with g++
so
that libstdc++
is
auto-linked in too.