gcc provides several default options for ld.
ldknows nothing about C ++ or any other language. ldI have no idea what libraries your code should work with. If you try to directly link your compiled C ++ code with ld, it will help you, as it ldalone does not know where it can find the runtime library libstdc++, gcc C ++. Do you use strings? vectors? Most of them are template code that compiles as part of your object module. But there are a few more pre-compiled bits in libstdc++which you need to associate.
gcc , gcc , ld, ld, , , .
ld, , , , gcc. ? gcc gcc-compiled c ode.