4 ms·
Wouldn't this run afoul of the ODR, anyway?
by brandmeyer 10y ago
Wouldn't this run afoul of the ODR, anyway?
- blub 10y agoI don't think so, ODR applies per program, the library and main program are separate. Object layouts will be likely different and the main program will probably crash.
- brandmeyer 10y agoNot so: The Standard doesn't have anything to say about the differences between static and dynamic libraries, or the differences between a .exe and its .dll's (or .so's). The program is composed of all the things that link into it as far as the ODR is concerned. The breakage from mixing different library versions (say, MSVCRT versions, for example) is a direct result of violating the ODR.
- blub 10y agoThe standard doesn't say anything at all about dynamic linking AFAIK, so it's basically OS-dependent. I think it works (as in the algorithm is well defined) in Linux, but it's best avoided due to complexity and non-portability.