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



N.B. an additional data point:

Before an official distribution of GTK+ 3 for Win32, binaries were maintained here: http://www.tarnyko.net/dl/gtk.htm

These packages contain .LIB files, and the tutorial explicitly describes how to build an application with MSVC (cl): http://www.tarnyko.net/repo/gtk3_build_system/tutorial/gtk3_tutorial.htm

When linking the 3.6.4 Tarnyko.net binaries to my application, I have the exact same behaviour as with the current MSYS2 release binaries (i.e. text not rendering to the cairo data surface, but no errors thrown either).

The above indicates that the distributed binaries (Tarnyko.net and MSYS2) are supposed to be able to be linked with MSVC applications.

On 6 September 2017 at 15:29, Jeffrey Sheen <jeffrey sheen00 alumni imperial ac uk> wrote:
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 gmail com> 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 gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list





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