Re: GTK+ mingw32 dynamic linking conflict (cairo/pangocairo)



On 9/5/2017 7:48 PM, Jeffrey Sheen wrote:
Thank you Emmanuele,

That is the first time I've heard that MinGW binaries (gcc) and the MSVC build
chain are incompatible. It would explain why I have non-functional behaviour in
my application.

This article on the MinGW website indicated that there was
interoperability: http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs


Any DLL that exposes C++ interface (so this does not apply to GTK+, but it's
still useful to keep in mind) is incompatible if it's compiled by different
compilers (especially MSVC and GCC; hell, even compiling with different GCC
versions makes them incompatible).

DLLs with C interface are nominally-compatible. The main source of
incompatibilities are:
1) Wrong compilation (for example - not using the MS alignment for structs when
compiling code with GCC). Code compiled with MSVC is nominally usable in
GCC-compiled programs (you are, after all, using MS W32 API DLLs, and MSVCRT -
these are compiled with MSVC).
2) Different C runtimes - MinGWs generally link to MSVCRT, unless you make them
do otherwise; MSVC generally links to different MSVCR versions, passing around
C object IDs (file descriptors, for example), will lead to bad stuff happening.

Also, debug information is incompatible (MS debugger doesn't understand dwarf
debug info; gdb doesn't understand pdb debug info).

As long as headers are written correctly, and runtimes are compatible (or
runtime differences are accounted for), it's possible to use C-interface DLLs
compiled with different compilers.


-- 
O< ascii ribbon - stop html email! - http://arc.pasp.de/

Attachment: 0x8DADE9276759BA74.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]