Re: problems while compiling gtk with MSVC



It was necessary to compile using -mms-bitfields and the runtime is
msvcrt71.dll ( so msvc users need to use -MD when compiling ).

With MSVC6 and earlier, -MD means the produced executable (.exe or
.dll) will use the msvcrt.dll C runtime. Does it have a different
meaning in MSVC7, to use msvcr71.dll? Can one produce executables
that use msvcrt.dll at all with MSVC7?

It is very important that the GLib and GTK DLLs (maybe also Pango) use
the same C runtime DLL as the client application. Recall that "file
descriptors" (the small numbers returned from the open() function) are
specific to the C runtime used. If an application uses a different C
runtime than GLib, no way in hell will stuff like
g_io_channel_unix_new() or g_file_open_tmp() work. A file descriptor
valid in one C runtime is not related at all to an numerically
identical file descriptor in another C runtime. Remember that a FILE
struct contains the file descriptor number, so the problem also
affects stdio, not just the "low-level" Unixish open()/write()/read() API.

There are presumably similar issues for stuff like environment
variables, locale setting, etc. Mixing C runtimes in an application
and the DLLs it uses can cause very strange behaviour. Don't do it,
unless you are absolutely sure you know what you are doing, and have
analyzed the situation closely.

--tml



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