www.digitalmars.com         C & C++   DMDScript  

c++ - Compiling nedmalloc

reply "Craig Black" <cblack ara.com> writes:
I've been talking with Niall Douglas, the author of nedmalloc about my
problems with compiling it using DMC.  He says the libraries are outdated.
In addition to the problem posted below, it seems that DMC's kernel32.lib
does not include the required functions TryEnterCriticalSection and
Initialize CriticalSectionAndSpinCount.

On 5 Jan 2007 at 11:33, Craig Black wrote:

 Sorry I didn't respond sooner. Someone told me that it didn't compile
under
 DMC, so to verify I had to find the time to try it myself. nedmalloc.c
does
 compile, but test.c does not. It could be a problem with the Digital Mars
C
 compiler. Perhaps if we can figure out what the bug is, we can report it.
Or
 maybe there is a quick fix that you could implement to get it working.
 Here's the error messages I get.

 C:\nedmalloc>..\dm\bin\dmc test.c -w -c
 HeapSetInformation(win32heap, HeapCompatibilityInformation,
 &data, sizeof(data));
 ^
 test.c(228) : Error: undefined identifier 'HeapCompatibilityInformation'
 --- errorlevel 1

 Thanks in advance.
Heh, that's dirt easy! Your friend is using an old SDK which isn't defining HeapCompatibilityInformation. He can upgrade it, or else substitute 0 for it. See http://msdn2.microsoft.com/en- us/library/aa366705.aspx. Cheers, Niall
Jan 05 2007
parent reply "Craig Black" <cblack ara.com> writes:
 In addition to the problem posted below, it seems that DMC's kernel32.lib
 does not include the required functions TryEnterCriticalSection and
 InitializeCriticalSectionAndSpinCount.
After talking with Niall some more, we found that we could get rid of the TryEnterCriticalSection link error by adding the line #define _WIN32_WINNT 0x403 before #include <windows.h> Curiosly, this did not fix the link error with InitializeCriticalSectionAndSpinCount. After further investigation, I found that both are found in DMC's kernel32.lib. Perhaps the function parameters are different. I still think DMC may need to upgrade it's libraries. Anyone have any other ideas? -Craig
Jan 05 2007
parent "Paul McKenzie" <paulm dynasoft.com> writes:
"Craig Black" <cblack ara.com> wrote in message
news:enm7q2$2ub2$1 digitaldaemon.com...
 Anyone have any other ideas?

 -Craig
Why not just use the implib.exe found in the installation BIN directory? Then you can just create the library from the DLL if the library is not up-to-date. Paul
Jan 06 2007