I have the following source code in main.cpp:
#include #include int main() { std::cout << \"Hi\" << std::en
I think if you use ld directly it does not include the C++ libraries by default. You can use g++ to do the linking as well, it will call ld with the correct settings.
ld
g++
g++ -c main.cpp g++ -o main main.o