[Top][All Lists]

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

Re: Compilation problems with latest MSVC

From: Jason Rumney
Subject: Re: Compilation problems with latest MSVC
Date: Sun, 31 Dec 2006 00:13:18 +0000
User-agent: Thunderbird (Windows/20061207)

Eli Zaretskii wrote:
Date: Fri, 29 Dec 2006 23:43:17 +0000
From: Jason Rumney <address@hidden>
Cc: address@hidden, address@hidden

The crash is happening within the initialization code before any Emacs code gets run (__tmainCRTStartup). This code is calling _free_internal, which we are redefining in gmalloc.c.

That rings a bell: during linking, the linker complained about
multiple definitions of some memory-related functions, I think calloc
and realloc.  Did you have those warnings in your build?
Yes, they appear as errors if you link against libcmt.lib, unless you include -force:multiple in LINK_FLAGS. I suspect that the single threaded library is required for Emacs, as the multithreaded library will be allocating heap memory for each thread behind your back to avoid problems with global variables, so there will always be a conflict between Emacs's and the C library's malloc routines.

I also tried linking against msvcrt.lib (the dynamic linked version of libcmt). It doesn't complain about the multiple definitions, but there are more unresolved symbols. I also recall Andrew Innes trying in the past to get Emacs working with the dynamic linked c runtime, I'm not sure if he succeeded in the end by ensuring that Emacs's memory allocations do not intertwine with the system library's or whether he gave up.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]