. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-debug
ac_add_options --enable-debug
ac_add_options --disable-optimize
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
Do I have to use some other options to keep all the lib files around?
pipnss.dll is an XPCOM component. What use would you have for an import
library? (XPCOM components are dynamically loaded and are never linked against).
--BDS
This thread over @mozilla.dev.security should give a good background
of what I am trying to do -
http://groups.google.com/group/mozilla.dev.security/browse_thread/thread/c1352bd98360cf24#.
In short, I am trying to get the 5th field in cert_override.txt as
described here https://developer.mozilla.org/En/Cert_override.txt.
This can be done via nsNSSCertificate object. So when I am trying to
instantiate that object: nsNSSCertificate *cert =
nsNSSCertificate::ConstructFromDER(derBuf, derLen); the linker on
windows throws this error:
"error LNK2019: unresolved external symbol "public: static class
nsNSSCertificate * __cdecl nsNSSCertificate::ConstructFromDER(char
*,int)" (?ConstructFromDER@nsNSSCertificate@@SAPAV1@PADH@Z) referenced
in function _main"
So the linker was not able to find the exported symbol & after a bit
of digging around make files, it seems the library (or dll in this
case) which exports all the NSS symbols are in pipnss. And to compile
my code I need the pipnss.lib to link against. I didn't know that
pipnss was a XPCOM dll & for that matter I have never worked with
XPCOM either. So when you compile a XPCOM dll, it doesnot generate an
interim lib file like you do in a normal dll? And if not then I guess
I have to load the pipnss.dll in my code to pretty much what I want to
do, right?
> In short, I am trying to get the 5th field in cert_override.txt as
> described here https://developer.mozilla.org/En/Cert_override.txt.
> This can be done via nsNSSCertificate object. So when I am trying to
> instantiate that object: nsNSSCertificate *cert =
> nsNSSCertificate::ConstructFromDER(derBuf, derLen); the linker on
> windows throws this error:
>
> "error LNK2019: unresolved external symbol "public: static class
> nsNSSCertificate * __cdecl nsNSSCertificate::ConstructFromDER(char
> *,int)" (?ConstructFromDER@nsNSSCertificate@@SAPAV1@PADH@Z) referenced
> in function _main"
You really aren't going to be able to use these objects in that way. First
of all, these symbols are not exported from the DLL: the only symbol that is
exported is NSGetModule. Secondly, all of that code depends on XPCOM being
initialized.
You'd be much better off using the XPCOM APIs from within a web browser
extension to get that information. I don't really know which APIs you need,
but you can see some of the important ones here:
http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/public/
--BDS
I was trying to compile against the mozilla source code itself (at
least that is how I did it in Linux). So I was assuming I could do the
same in windows too. So when the linker didn't find the required
symbol, I checked the make file for that directory (security/manager/
ssl/src) & the module it was referring to was pipnss, so I assumed it
was exporting it.
> You'd be much better off using the XPCOM APIs from within a web browser
> extension to get that information. I don't really know which APIs you need,
> but you can see some of the important ones here:
>
> http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/pu...
>
Thank you. If I can find the right method calls, this would be a much
cleaner (& reliable) approach than what I am currently doing.