From: krish on
I'm facing some problems while using _vsnprintf in diskperf.c.

When I use: length = _vsnprintf (text, sizeof (text) - 1,
DebugMessage, ap); I get a warning "warning C4995: '_vsnprintf': name
was marked as #pragma deprecated".

So used the safer version as: length = _vsnprintf_s (text, sizeof
(text), sizeof (text) - 1, DebugMessage, ap); But then I got the
errors:

diskperf.obj : "error LNK2019: unresolved external symbol
__vsnprintf_s referenced in function _DebugPrint"
diskperf.sys : "error LNK1120: 1 unresolved externals"

It appears that I need to link some other (shared)object. Any help?
Thanks.
From: Praveen Kumar Amritaluru on
What is the OS version for which you are compiling?

vsnprint is deprecated on Vista & above.
RtlStringCbVPrintfA needs to be used instead.



"krish" <pradeep_bisht(a)yahoo.com> wrote in message
news:9ca80cc8-7098-43e2-ae6c-b29945b85b53(a)x1g2000prh.googlegroups.com...
> I'm facing some problems while using _vsnprintf in diskperf.c.
>
> When I use: length = _vsnprintf (text, sizeof (text) - 1,
> DebugMessage, ap); I get a warning "warning C4995: '_vsnprintf': name
> was marked as #pragma deprecated".
>
> So used the safer version as: length = _vsnprintf_s (text, sizeof
> (text), sizeof (text) - 1, DebugMessage, ap); But then I got the
> errors:
>
> diskperf.obj : "error LNK2019: unresolved external symbol
> __vsnprintf_s referenced in function _DebugPrint"
> diskperf.sys : "error LNK1120: 1 unresolved externals"
>
> It appears that I need to link some other (shared)object. Any help?
> Thanks.


From: krish on
Thanks Praveen.


On Jun 12, 4:30 am, "Praveen Kumar Amritaluru"
<apraveen.ku...(a)gmail.com> wrote:
> What is the OS version for which you are compiling?
>
> vsnprint is deprecated on Vista & above.
> RtlStringCbVPrintfA needs to be used instead.
>
> "krish" <pradeep_bi...(a)yahoo.com> wrote in message
>
> news:9ca80cc8-7098-43e2-ae6c-b29945b85b53(a)x1g2000prh.googlegroups.com...
>
> > I'm facing some problems while using _vsnprintf in diskperf.c.
>
> > When I use: length = _vsnprintf (text, sizeof (text) - 1,
> > DebugMessage, ap); I get a warning "warning C4995: '_vsnprintf': name
> > was marked as #pragma deprecated".
>
> > So used the safer version as: length = _vsnprintf_s (text, sizeof
> > (text), sizeof (text) - 1, DebugMessage, ap); But then I got the
> > errors:
>
> > diskperf.obj : "error LNK2019: unresolved external symbol
> > __vsnprintf_s referenced in function _DebugPrint"
> > diskperf.sys : "error LNK1120: 1 unresolved externals"
>
> > It appears that I need to link some other (shared)object. Any help?
> > Thanks.