Why should the same compiler be used for the dependent application as the dynamic library?

I recently had to compile Qt, and the instructions clearly state that my application must be compiled with the same compiler as the one with which I compile Qt. Now I don’t understand the reason for this and would like to know if this is specific to Qt or C ++ common thing?

+4
source share
1 answer

Introduction

, , . MinGW: . , .

Dll . DLL, , , . , DLL C, ++. , MinGW ++ C, Windows. DLL, ++, , C, extern "C". , , , , ++ -.

, . , , DLL. , - . : -

++ , .

, , " " " , - .

GNU g++ MSVC ++ / DLL, MSVC, , - ++. : -

  • , .def.
  • , (-mms-bitfields,...).
  • : -

/ malloc/free DLL MSVC / Cygwin newlib malloc/free. , new/malloc .

, DLL MSVC, Cygwin .

GNU SJLJ ( GCC-3.x ) MSV++, DWARF2 ( GCC-4.x), .

.

+4

Source: https://habr.com/ru/post/1540008/


All Articles