"how does one determine which libraries need to be linked to in this manner and which ones are covered by #INCLUDE statements in my code?"
OK, that really does say that you need to learn C++ more -- #include does not cover ANY library linkage.
Maybe I worded that wrong. I understand (mostly) the differences between including and linking. My question was, once the MySQL libraries were installed, why couldn't I access them by using #INCLUDE <> like I do with <iostream>, for example? Is it because the MySQL libraries aren't in my system path or their location otherwise known by the compiler/linker? I think you explained that pretty well. Thank you again.
I know what you're thinking, you're thinking how do you know which -lxxx goes with which #include??
So there's several ways. One is to find whoever wrote the library and beat the information out of them with a length of rubber hose. However we save that until last resort because it discourages software development and also rubber hose is actually quite hard to come by in this day and age.
You can look in the manual pages. If you look in "man dlopen", for example, it says
SYNOPSIS
#include <dlfcn.h>
void *dlopen(const char *filename, int flag);
char *dlerror(void);
void *dlsym(void *handle, const char *symbol);
int dlclose(void *handle);
Link with -ldl.
For mysql, it's in the manual;
19.8.16. Building Client Programs
If you compile MySQL clients that you've written yourself or that you obtain from a third-party, they must be linked using the -lmysqlclient -lz options in the link command. You may also need to specify a -L option to tell the linker where to find the library. For example, if the library is installed in /usr/local/mysql/lib, use -L/usr/local/mysql/lib -lmysqlclient -lz in the link command. For clients that use MySQL header files, you may need to specify an -I option when you compile them (for example, -I/usr/local/mysql/include), so that the compiler can find the header files.
See -- this is why we very rarely have to beat the information out of people.
...and that's the kind of info I'm missing that will make my life a lot easier. Adding that to your tip about using grep with locate has really moved me forward in terms of understanding what's going on in this brave new world of Linux.