According to this question,
Dynamic linking is done at run time, by the operating system.
Until now, using g++ with eclipse CDT, I statically linked odbc32.lib I got from windows SDK to get some ODBC functions to my program. But I deleted the file by accident and was surprised to find my program still running and connecting to the database. Since the file no longer existed the the path I specified to the -L option, I thought it must still exist somewhere in one of the subfolders of the path. But then I deleted the library path to see what happens but my program still works! I began searching for odbc32.lib and I really can't find it. However, I do found a odbc32.dll file located in C:\Windows\System32 and I thought it might be dynamically linked to my program.
- If I'm right, How does the compiler find odbc32.dll when I never specified C:\Windows\System32 as my library path?
- To test my theory, I began grabbing many .dll files in the system32 folder and linked them using -llibrary. I've managed to link some of the files I got because my program run successfully, but some files can't be found by the linker, why is that?
Am I right? Is this an example of dynamic linking?
Note: I also removed C:\Windows\System32 from my path but it's still, for some reason, working.