2

I’ve been using MinGW32 to compile libraries and link statically to my programs.

I would like to know if I change the compiler to TDM-GCC would my old libraries link with new programs compiled with TDM? Or should I compile everything with the new compiler?

Thanks

Mr blunder
  • 71
  • 6
  • Wouldn't it be easiest just to re-compile? – David Heffernan Dec 29 '13 at 16:29
  • Not really, for instance, compiling POCO with mingw is not easy, isn't it? Try yourself. – Mr blunder Dec 29 '13 at 16:39
  • Oh, I did not realise that your code was hard to compile. You didn't really say much about it. So what are these libraries? Static libraries? Or import libraries to DLLs? And if static, how are they linked to the runtime? – David Heffernan Dec 29 '13 at 17:07

1 Answers1

1

The answer to your question largely depends on what the libraries are, and how you link to them.

If the libraries are import libraries for DLLs, then you may not need to re-compile. However, if the DLLs need to link to the same C++ runtime as the host executable, then you will need to re-compile if your host executable uses a different runtime from the DLL.

If the libraries are static libraries then you will need to re-compile if the static library is linked against a different C++ runtime from the program into which it is linked.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490