Assume main.c uses symbols from shared libs and local functions declared in main.c.
Is there a nice and elegant way to print a list of all
This is not really C specific, but operating system and binary format and (for debugging symbols and unmangled C++ symbol names) even compiler specific question. There is no generic way, and also no truly elegant way.
The most portable and future-proof way is probably running external program such as nm, which is in POSIX. GNU version found in Linuxes probably has a bunch of extensions, which you should avoid if you aim for portability and future-proofness.
Its output should stay stable, and even if binary formats change, it will also get updated and keep working. Just run it with right switches, capture its output (probably by running it through popen to avoid a temp file) and parse that.