I just installed gcc 7 in a arbitrary folder. I am able to compile using the full path to bin folder of my new gcc 7 installation, but when I try to run my program, it complains of missing libs. How must I fix this? I must provide the lib files path somehow? How to do this?
If your carbitray compiler installation (or toolchain) comes with a lib folder, you can try to set the library path (see http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html)
or execute the binary like this:
But this may be only a part of your problem. If the libraries of your compiler/toolchain are also using additional shared libraries you need to install them as well.
A proper toolchain packages sould contain a folder like x86_64-linux-gnu/sysroot/lib. This folder should contain the shared libraries required for your compiled application.