views:

193

answers:

3

I'm trying to link my XPCOM extension against the 1.9.3a3pre SDK and I get the following:

error LNK2001: unresolved external symbol _moz_xmalloc

So, what lib do I need to link to? The documentation doesn't say.

This is on Windows right now, but I'll need it to build on Mac and Linux (32bit/64bit) as well.

Edit: Now with bounty.

Edit: Update: Turns out FF3.7 was cancelled. So I don't have to worry about this until FF4.

+1  A: 

I have same error, and linking to mozalloc helps for that.

miara
mozalloc wasn't in the xulrunner sdk (for Windows) that I downloaded. Where did you get it?
jeffamaphone
I was writing an extension for Thunderbird and I've build Thunderbird from sources before that (using latest comm-central), and this lib was in mozilla/dist/lib in Thunderbird build directory, so in your case it is probably not the solution. Does linker said where the linking error occured (what was the object the symbol was referenced in)?
miara
xpcomglue_s.lib(nsCOMPtr.obj) : error LNK2001: unresolved external symbol _moz_xmallocxpcomglue_s.lib(nsComponentManagerUtils.obj) : error LNK2001: unresolved external symbol _moz_xmalloc
jeffamaphone
Pretty sure you're right about what I need to link too... I just wonder where to get it. Perhaps they haven't got it building on Windows yet so the xulrunner SDK doesn't have it? Maybe I just need to wait for beta?
jeffamaphone
can you give me link for mozalloc.lib, I can't find it in Mozilla Central latest SDK.
Priyank Bolia
A: 

Try defining MOZ_NO_MOZALLOC when compiling your extension, you will then get a DLL that uses your CRT's allocators. (Don't forget to use the NS_* allocators for XPCOM-compatible memory.)

Neil
Ah, this is relevant to my interests! I'll give that a shot.
jeffamaphone
This does not worked for me, even after using that getting: unresolved external symbol __imp__moz_xmalloc
Priyank Bolia
A: 

Can u please give me the link to download Geck SDK 1.9.3a3pre

Amol