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

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

 



Thank you for the alternate information LRN.

If the mingw DLLs are incompatible, then they are failing silently, as my MSVC application compiles and runs without throwing errors. In your experience, would you expect this, or would you expect the binary incompatibilities to cause failure at runtime?

I'm interested in being able to validate the mingw DLLs' compatibility with MSVC, either programmatically, or by contacting the package maintainer (any idea how to establish who that might be?).

On 5 September 2017 at 18:05, LRN <lrn1986@xxxxxxxxx> wrote:
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/

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux