solution to unresolved external symbol _com_issue_error _bstr_t::_bstr_t

16 March 2006 | 46 Comments

LNK2019: unresolved external symbol “void __stdcall _com_issue_error(long)” (?_com_issue_error@@YGXJ@Z) referenced in function “public: __thiscall _bstr_t::_bstr_t(unsigned short const *)” (??0_bstr_t@@QAE@PBG@Z)

I despise this error. Every time I write a new ATL or WTL app, and don’t use COM much in it, I get this.
I then plow for 10 minutes throuh newsgroups to get it figured.
So, hopefully Google will pick this text up and make the solution shorter for other people.

SOLUTION: #include <comdef.h>

Ben says that If #include comdef.h does not fix the unresolved externals, then make sure you are also linking against comsupp.lib

46 Responses on “solution to unresolved external symbol _com_issue_error _bstr_t::_bstr_t”

  1. Anonymous says:

    Hi!

    Tnx. It really helped :-)

    BTW. It happens also with _variant_t

  2. Anonymous says:

    Definately helpful. Thanks.

  3. Anonymous says:

    WOW.. man it really worked!!! Three times cheers to you buddy ..

  4. Anonymous says:

    Thanks. quick and to the point.

  5. Ed McMan says:

    Thanks

  6. Anonymous says:

    Really thanks !!! That was an amazing help :)

  7. Anonymous says:

    Thanks!

  8. Anonymous says:

    Exactly what I needed to know.
    Thankyou!

  9. Anonymous says:

    Thanks, this helped loads.

  10. Paul Maddox says:

    EXCELLENT, thanks for the help!

    (PS. You might want to turn on comment reviews to avoid the spam. :-) )

  11. Hatch Chili Daddy says:

    Cool Beans! Thanks!

  12. Ben says:

    Ohad, thank you for this! It is indeed the first Google hit. Please update it as follows: If #include comdef.h does not fix the unresolved externals, then make sure you are also linking against comsupp.lib. That fixed it for me.

  13. Jonas says:

    Haha! Thanks a lot! :-)

    I got 15 of those when I now recompiled my project after a lot of changes. Found you via Google!

  14. Anonymous says:

    At risk of repeating everyone else – thanks a lot – the evil compiler error is dead – hurrah!

  15. Rabindra says:

    Thanks man, its really helpful
    i was searching for a long time for the conversion..

    Cheers,
    Rabindra

  16. Anonymous says:

    adding comsupp.lib worked for me w/o adding #include comdef.h

  17. Anonymous says:

    THANKS !

  18. Fish in a Barrel says:

    Google did indeed take me right to this answer. Thanks!

  19. franiu says:

    Google did its job!

    Thans a lot!

  20. Gem says:

    Thank you very much!

  21. Anonymous says:

    Even now, 2 years after its original date – this post continues to help lost souls on the Internet. Thanks!

  22. Pals says:

    Thank you! Thank you! Thank you!!!

  23. Anonymous says:

    Thank you! You saved the day :)

  24. sb says:

    many many thanks!!

  25. Googler says:

    you + google = problem solved!!

    Many thanks

  26. Stan says:

    Thank you. It really helped :-) )

  27. eldo says:

    Thank you! Very needed solution!

  28. ibmm says:

    Great thanks!!!

  29. Anonymous says:

    Thanks a bunch….Really really appriciate. It make my day and saved my hair!!!!!

  30. Gustavo says:

    Thanks a lot!!!

  31. Marius says:

    It really helped! Thanks!

  32. Carlos says:

    Thnk you very much. It really help a lot. Exact and short, makes it much more valuable. Have a nice day ;-)

  33. Mano says:

    Thanks a lot :-)

  34. Madan says:

    Proved to be really helpful. Especially when you are distressed and see nothing bright in front of you….this useful tip has shown me life.
    Thanks a lot my dear friend.

  35. Sergey says:

    thanks!

  36. Hamo says:

    Yesss! Thank you very much for saving my time!

  37. san says:

    It didn’t solve it for me. But I did figure it out.

    I had to add this to my sources file.

    USE_VCCOM=1

  38. Oleg says:

    Thanks a ton!

  39. Boston Greg says:

    Dude, you are awesome!

  40. Marty Hirsch says:

    Hi. I want to use _bstr_t and I have #include and I added comsupp.lib to the library list and I still get this error.

    The build is driven by a vcproj so we don’t use “sources” files. The moment I invoke _bstr_t this error results. Is there any solution?

  41. Marty Hirsch says:

    Hi That’s #include comdef above, somehow the posting omitted the string comdef, maybe due to the greater than/less than characters.

  42. Steinar Meen says:

    Thanx

  43. sara says:

    when i include
    an error occur it is ‘internal compiler error’

  44. Ying says:

    Thanks, dude, it is great concise post. :-)

  45. Dano says:

    thanks! it helps a lot, IT is the solution to the problem that we had in our work with compiling a specific dll file. (we are NOT programmers)

  46. izeye says:

    You saved me. Thanks!

Leave a Reply