Monday, June 21, 2010

Try DLL'ze your Legacy code

DLL's are awesome, why to update your whole code for a simple change, just update DLL's. Get DLL's and get your build time down just like a squeezed lemon :) . But have you ever tried getting DLL's for the executable containing nearly 150 libraries and you are handling the legacy code running from last 20-25 years?
Making DLL's of smaller number of libraries are easier but the time consumption in the process of creation if you get into more and more libraries.
Common errors which you may face while creating the DLL:
1) While Linking: Unresolved symbols. To resolve check your link line, you probably have not included the required library.
2) Circular dependency tree: This is most annoying and requires a bit of hard work. Either the dll you are creating is itself is the dependency of a library (of a DLL) that you have included or that library depends on some other which interns depends to it.
3) Linking error, symbol already in libcpmt.dll (static) and msvcrt*.dll (dynamic) both. In such cases check your objects, some of them would have got build with MT flag. Convert them to MD and linking will get succeed.