Re: ConvertStringToBSTR linking error



Hi Bruno,

I managed to get rid of the error finally by recompiling another library
that I hadnt mentioned I was linking in the list. It now doesnt look for
said function.

Cheers for your help and sorry for my delay getting back to you. And
cheers for telling me the reason why this happens, very informative!

Nick.

"Bruno van Dooren" <bruno_nos_pam_van_dooren@xxxxxxxxxxx> wrote in message
news:%238mVYslLGHA.2624@xxxxxxxxxxxxxxxxxxxxxxx
I have a VC Win32 application compiling under VS.NET 2003 no problems,
but when attempting to compile under VS.NET 2005 I am recieving linker
problems. The only main difference between the 2 systems is that I am
using the latest platform SDK on the 2005 system in order to utilize the
latest DirectX (DirectShow) SDK.

Anyway, the linker error I'm recieving is

Error 79 error LNK2019: unresolved external symbol "wchar_t * __stdcall
_com_util::ConvertStringToBSTR(char const *)"
(?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function
"public: __thiscall _bstr_t::Data_t::Data_t(char const *)"
(??0Data_t@_bstr_t@@QAE@PBD@Z) MTDetector.obj
Error 80 error LNK2019: unresolved external symbol "char * __stdcall
_com_util::ConvertBSTRToString(wchar_t *)"
(?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function
"public: char const * __thiscall _bstr_t::Data_t::GetString(void)const "
(?GetString@Data_t@_bstr_t@@QBEPBDXZ) MTDetector.obj
Error 81 error LNK2001: unresolved external symbol "char * __stdcall
_com_util::ConvertBSTRToString(wchar_t *)"
(?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) SrcFilter.obj
Error 82 error LNK2001: unresolved external symbol "char * __stdcall
_com_util::ConvertBSTRToString(wchar_t *)"
(?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) TCSource.obj
Error 83 fatal error LNK1120: 2 unresolved externals Raptor - <filename>

I can't find any references to this call in any of my source code so I
can only presume that something else I am linking in is requiring this
reference?

The libraries I am including and also include in VS.NET 2003 which
compiles perfectly are...

comctl32.lib
ws2_32.lib
gdiplus.lib
winmm.lib
strmbase.lib
kernel32.lib
user32.lib
gdi32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
msimg32.lib
imagehlp.lib
msxml2.lib
wmvcore.lib
wininet.lib
rpcrt4.lib

What confuses me most is why this would work in 2003 and not 2005?
Had anyone else experienced this problem and have any kind of a resolve?
Thanks I'm eagerly awaiting some answer, cheers in advance!

from the ConvertStringToBSTR documentation in MSDN 2005,
Header: comutil.h
Lib: comsuppw.lib or comsuppwd.lib (see /Zc:wchar_t (wchar_t Is Native
Type) for more information)

in MSDN2003, it specifies commsupp.lib, not comsuppw.lib

you lib list does not include comsuppw.lib. Try to add it.
I seem to remember someone mentioning on this list that this problem is
caused
by the fact that the default for wchar_t changed from VC2003 to VC2005.


--

Kind regards,
Bruno.
bruno_nos_pam_van_dooren@xxxxxxxxxxx
Remove only "_nos_pam"




.



Relevant Pages

  • dynamic linking -> static linking == some _smaller_ executables
    ... been linking those executable programs entirely dynamically. ... where they still link all system libraries ... those other libraries have to be added because there are references, ... When statically linking libc, executables get huge fast. ...
    (comp.unix.programmer)
  • Re: [opensuse] g++ compile question on openSUSE 11.2
    ... factors, including an error in the system libraries, or an ... incorrect mix of libraries when linking. ... references to this topic. ...
    (SuSE)
  • RE: Built in function errors.
    ... I have yet to work with 2007 and certainly not in a mixed environment. ... I've replaced UCase intrinsic function located in the Control ... ways of trying to match all the libraries but so far nothing has worked 100%. ... It is probably that these issues are not related to references. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Built in function errors.
    ... I've replaced UCase intrinsic function located in the Control ... ways of trying to match all the libraries but so far nothing has worked 100%. ... It is probably that these issues are not related to references. ... updating the software on the client computer and reselecting all ...
    (microsoft.public.access.modulesdaovba)
  • Re: YASID: Gargoyles, but no rats
    ... There were some references to, I think, gargoyles that had ... libraries in town. ... or in the agents of a God. ...
    (rec.arts.sf.written)