0

I have linked set of dll's which are built using visual studio 2015 to a Visual Studio 2012 application, strangely I haven't seen any linker issues and I am able to execute the API's provided by those dll's. Will there be any problem with this approach? Why I haven't got binary compatibility problem ?

Revanth
  • 59
  • 8
  • 1
    It is pretty easy to trigger UB, but that's not necessarily the case. The standard example is the operating system DLLs that you link, they don't care what VS version you use. They were well-designed to avoid UB. Basic rules are to avoid a scenario where you allocate memory in one module and destroy in another, avoid C++ template objects and exceptions, and avoid shared CRT state like errno. – Hans Passant Nov 26 '19 at 12:08
  • It is pretty easy to trigger UB what it means? – Revanth Nov 26 '19 at 12:14
  • 1
    Undefined Behavior, it is Bad. Come to think of it, VS2012 helps a lot by no longer creating a private heap so scratch the memory allocation problem. – Hans Passant Nov 26 '19 at 12:17
  • What sort of things are you passing to/from the dlls? Have you tried all of the APIs yet? – doctorlove Nov 26 '19 at 12:25
  • @doctorlove initializing framework present in dll through some API calls and passing a file which will be traversed and returns set of objects. I haven't tried all API's yet – Revanth Nov 26 '19 at 12:29
  • Depending on how the "set" of "objects" are created and returned you might get away with it. Some of the standard library contains and other things allocating memory might cause trouble. If you just pass ints back and forth you might be ok. – doctorlove Nov 26 '19 at 12:31
  • If I use VS 2015 built dll's to for a VS 2012 dll and then try to load VS 2012 dll, it complains procedure entry point not found. – Revanth Nov 26 '19 at 14:05

0 Answers0