Re: problems while compiling gtk with MSVC



Tor Lillqvist wrote:

Hubert Sokolowski writes:
> it. I get a window telling that my app caused a fault or something.
> my exe is compiled using gcc. is it possible to use msvc dll's with exe
> compiled with gcc?

For the DLLs built and distributed by me, yes. That is something that
is suppposed to work, and has been tested many times. Both compiling
GLib or GTK with MSVC6 and app with gcc, and the other way. You have
to use the -mms-bitfields when compiling with gcc in order to get
identical struct layout, though. And when compiling with MSVC6 you
should use the -MD switch to use the MSVCRT.DLL runtime.

I can't promise anything about binaries built by others, though. Other
people don't necessarily take binary compatibility issues
seriously. (Ditto for installation location independence and
multi-language support.)

The severna.homeip.net site says that its binaries are built with
Visual Studio 7. This probably means the DLLs don't use the MSVCRT
runtime. If so, it is almost certain that they won't be fully useable
from code that does use MSVCRT, like that compiled by gcc or earlier
versions of MSVC. I hope the severna guy uses different names for his
DLLs.
Actually, I just tested it using reimp from mingw-utils package and was successful in getting a simple libglade app to compile and execute. It was necessary to compile using -mms-bitfields and the runtime is msvcrt71.dll ( so msvc users need to use -MD when compiling ). Picking names has actually been something of a great delema for me. Do I name the .libs the same as they are in Tor's package? Do I name the dlls the same as Tor's package? If I provide the same name for the dlls then people can drop my dlls into an existing project without recompiling etc... Does this cause a problem? I'd really like to understand better what I should do. For the most part, I've tried very hard to make sure the symbols exported from the dlls I've compiled match the ones compiled from autoconf/automake. I'm certainly open to suggestions on how to make this better.

Also, I'd like to know what people think about me providing a cvs repository of the visual studio projects? I've been thinking about how best to do this, but just am not sure how valuable it really would be to anyone.

> or maybe I have to recompile my exe using lib and header files from
> above location?

The severna site talks about MSVC7 only, and presumably doesn't
provide any import libraries that GNU ld could use.
No, I assume if someone wants to do that they can use reimp, since I would assume the information provided by http://www.mingw.org/mingwfaq.shtml#faq-msvcdll should be adequate.

-todd




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