Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fail to call nsOutputStream::write

14 views
Skip to first unread message

LKY

unread,
Jul 7, 2008, 11:06:39 AM7/7/08
to
Hi all,

I am using Visual C++ 2005 to create an XPCOM component. I am facing
the following error.

error LNK2001: unresolved external symbol "__declspec(dllimport)
public: int __thiscall nsOutputStream::write(void const
*,int)" (__imp_?write@nsOutputStream@@QAEHPBXH@Z)

I believe that the error occurs when it run the following code:

char *s = PR_smprintf("xxxx");
PRInt32 L;
L = strlen(s);
//mStream is a variable of nsOutputFileStream.
if (PRInt32(mStream->write(s,L)) < L) {
return NS_ERROR_FAILURE;
}

Does any one know what is the problem with this error. Thanks in
advance.

Regards
LKY

Joshua Cranmer

unread,
Jul 7, 2008, 11:11:11 AM7/7/08
to
LKY wrote:
> Hi all,
>
> I am using Visual C++ 2005 to create an XPCOM component. I am facing
> the following error.

This is really a build problem.

> error LNK2001: unresolved external symbol "__declspec(dllimport)
> public: int __thiscall nsOutputStream::write(void const
> *,int)" (__imp_?write@nsOutputStream@@QAEHPBXH@Z)

Looks like a linking problem... With which libraries are you linking?

[ Rest of post included for those who do not read m.d.a.t ]

LKY

unread,
Jul 8, 2008, 2:34:42 AM7/8/08
to

Hi,

Thanks for reply. I am using Gecko SDK 1.8. Is this the libraries that
you mean?

Regards
LKY

PM

unread,
Jul 14, 2008, 4:10:22 AM7/14/08
to

LKY

unread,
Jul 23, 2008, 10:48:56 AM7/23/08
to
> (http://developer.mozilla.org/en/docs/XPCOM_Glue#Using_Mozilla_interna...)
> ?
>
> PM

Hi,

Thanks for reply. I am using Frozen linkage (dependent glue). For
Windows one.

regards
LKY

0 new messages