Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please I am Desperate-- Link Issue w/_bstr_t

Status
Not open for further replies.

DougCa

Technical User
Nov 1, 2002
13
0
0
US
Hi:

What library(s) need to be linked in order to avoid

LNK2019 unresolved external symbol "void_stdcall _com_issue_error(long)"
LNK2019 unresolved external symbol "unsigned short * _stdcall _com_util::ConvertStringToBSTR(char const *)"
LNK2019 unresolved external symbol _imp_SysFreeString@4 referenced in function "private: void_thiscall _bstr_t::Data_t::Free(void)"

I did include comutil.h.


When compiling/linking:

_bstr_t strVal(vendorData);


Thanks Very Much,
Doug Cabell
 
Thanks for the help. I really appreciate it.

Doug
 
I have the same problem trying to compile/link a MFC exe project with VC7. Have you solved the problem linking with comsupp.lib library?
I have done but I get the same error. also I have tested a very simple piece of code like this:
char* lpszText = "Test";
printf("char * text: %s\n", lpszText);
BSTR bstrText = _com_util::ConvertStringToBSTR(lpszText);
wprintf(L"BSTR text: %s\n", bstrText);
SysFreeString(bstrText);

and I have the same error:
error LNK2019: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function "public: __thiscall _variant_t::_variant_t(char const *)" (??0_variant_t@@QAE@PBD@Z)

Can anybody help me? I also am really desperate!!!!
Thanks in advance.
 
Yes, I solved it as stated. Sorry and good luck.
 
Well, it seems that I know where the problem was.
In order to link without error I have to set in Setting of the project in "C/C++ -> Language -> Treat wchar_t as Built-In Type" to "No" (originally it was: "Yes(/Zc:wchar_t)".

(I am working with Visual Studio .NET)

Thanks again.
 
Hello,

I want to control a Frequency Counter with the GPIB port and the example program given with the device doesn't work with Borland C++ builder and I have the same problem like you:
[Linker Error] Unresolved external '__stdcall _com_issue_error(long)' referenced from E:\BC++5_PRJ\TRY_COUNTER\UNIT1.OBJ
[Linker Error] Unresolved external '__stdcall _com_util::ConvertStringToBSTR(const char *)' referenced from E:\BC++5_PRJ\TRY_COUNTER\UNIT1.OBJ

Has someone an idea?

Sorry for the mistakes, I'm french.

Thank you for your help.

For more details: jmlefloch@ifrance.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top