First, if I am posting the query in the wrong place, please let me know
where I should post. Thanks in advance.
Anywya, I have run into an issue that I cannot seem to resolve
Background Info:
1) I have an extension consists of few XPCOM components. I compiling my
extension into a statically linked dll (so the user would not have to
install any other dlls to use my components). I am linking against
nspr4.lib, xpcom.lib, and xpcomglue_s.lib.
2) I am using VS2005 to build my project.
3) I am using the latest xulrunner sdk (gecko-sdk-1.9)
4) My components implement my own interfaces, plus
nsISecurityCheckedComponent, where I used "xpidl -m header" to generate the
header.
5) I am using these header files in my project:
#include "nsGenericFactory.h"
#include "nsIClassInfoImpl.h"
#include "nsICategoryManager.h"
#include "nsIServiceManager.h"
#include "nsMemory.h"
#include "nsComPtr.h"
Problem:
I get this error at link time:
error LNK2019: unresolved external symbol "public: void __thiscall
nsCOMPtr_base::assign_from_qi_with_error(class nsQueryInterfaceWithError
const &,struct nsID const &)"
(?assign_from_qi_with_error@nsCOMPtr_base@@QAEXABVnsQueryInterfaceWithError@@ABUnsID@@@Z)
referenced in function "public: __thiscall nsCOMPtr<class
nsIServiceManager>::nsCOMPtr<class nsIServiceManager>(class
nsQueryInterfaceWithError const &)"
(??0?$nsCOMPtr@VnsIServiceManager@@@@QAE@ABVnsQueryInterfaceWithError@@@Z)
DymoComponents.obj
Things I tried:
I found the function "VnsQueryInterfaceWithErr" (which is the function that
the linker cannot resolve) in xpcomglue_s.lib and saw the parameter
signatures are different. So I thought it might be because the .lib files I
am using is compiled and linked with a different compiler than the one I am
using. So I downloaded the XulRunner source and compile and built my own
.libs. When I link against the .libs I compiled, I get the same error.
This line of code is what triggered the linker to call the
QueryInterfaceWithError function:
nsCOMPtr<nsIServiceManager> servman =
do_QueryInterface((nsISupports*)aCompMgr, &rv);
But this code is from the Weblock sample I found from the tutorial on XPCOM
component. I am not sure what to do to get around calling this function...
Has anyone else run up against this issue? How did you resolve it?
Thanks.
This question belongs in mozilla.dev.extensions... cc'ing and setting followup.
> error LNK2019: unresolved external symbol "public: void __thiscall
> nsCOMPtr_base::assign_from_qi_with_error(class nsQueryInterfaceWithError
> const &,struct nsID const &)"
> (?assign_from_qi_with_error@nsCOMPtr_base@@QAEXABVnsQueryInterfaceWithError@@ABUnsID@@@Z)
> referenced in function "public: __thiscall nsCOMPtr<class
> nsIServiceManager>::nsCOMPtr<class nsIServiceManager>(class
> nsQueryInterfaceWithError const &)"
> (??0?$nsCOMPtr@VnsIServiceManager@@@@QAE@ABVnsQueryInterfaceWithError@@@Z)
> DymoComponents.obj
>
> Things I tried:
>
> I found the function "VnsQueryInterfaceWithErr" (which is the function that
> the linker cannot resolve) in xpcomglue_s.lib and saw the parameter
> signatures are different.
Are you sure you're looking for the right symbol? It appears to be looking
for and missing
?assign_from_qi_with_error@nsCOMPtr_base@@QAEXABVnsQueryInterfaceWithError@@ABUnsID@@@Z
You say you found a similar symbol but with different parameter
signatures... can you list the symbol that you found, and exactly how it is
different?
--BDS