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.
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.
From your comments, you stated you are using g++
with cygwin
. Basically this means that linking is now done as it is on linux (or unix or whatever) and one library is needed. In your case this is static library so it links upon compilation and doesn't need it again.