2

I've searched around here and a few other sites and still the linker error I'm having doesn't seem to be in there or my reading comprehension is failing me today.

The errors VS2010 is giving me are as follows:

Error 10 error LNK2001: unresolved external symbol "void __stdcall _com_issue_error(long)" (?_com_issue_error@@$$FYGXJ@Z)

Error 11 error LNK1120: 1 unresolved externals

I cannot seem to find anywhere what function is missing its external so I know what I should be importing or at the very least including in the linker so debugging it is proving a little hard.

Didn't even think to add this, but when I try and add comsupp to my linker I get the following errors (also my link.exe actually crashes and asks me if I want to send a debug report to Microsoft):

Error 15 error C1001: An internal error has occurred in the compiler.

Error 16 error LNK1000: Internal error during IMAGE::BuildImage

MSN
  • 53,214
  • 7
  • 75
  • 105
doyler
  • 147
  • 1
  • 8
  • Do you want to use COM, or do you want to track down where this reference is coming from? – Roman Starkov Jan 09 '12 at 20:03
  • I want to track down where this error is coming from and go from there. I didn't add anything COM based but my linker setup may vary from my teammate's (who is of course away) – doyler Jan 09 '12 at 20:10
  • Have you tried to #include ? – StevieG Jan 09 '12 at 20:20
  • Well I checked the file that I thought MIGHT be the one that requires comdef.h, but just including it there (and not touching the linker dependencies by hand) also crashes the linker. The line that is throwing the error when the linker actually crashes (for both cases) is as follows: `String^ libraryNameString = gcnew String(libraryName);` – doyler Jan 09 '12 at 20:26
  • So if I both include comdef.h and switch from gcnew to a marshal it will build that section but to be honest I'm not exactly certain WHY the other line crashes the linker and fails the build...`String^ libraryNameString = Marshal::PtrToStringAnsi( (IntPtr) (char*) libraryName);` – doyler Jan 09 '12 at 20:44
  • So I found someone with the same exact problem and same exact workaround, but no solution for him either... http://stackoverflow.com/questions/2632999/vc-incremental-linker-error-lnk1000 – doyler Jan 10 '12 at 18:08
  • 1
    Including comdef.h fixes this for me. I got the same linkk error when I used _bstr_t and constructed it from a const char* using comutil.h for the definition of _bstr_t. Using comdef.h for the definition fixes the problem. – persiflage Jan 23 '12 at 19:51

2 Answers2

4

Do include comdef.h, but don't include comutil.h

Ajay
  • 18,086
  • 12
  • 59
  • 105
zhen ma
  • 611
  • 1
  • 5
  • 3
1

Project Property ->Linker -> Input ->Additional Dependencies. Add comsuppd.lib (or comsuppwd.lib) if it's debug mode. Add comsupp.lib (or comsuppw.lib) if it's release mode.

Elliot Chen
  • 378
  • 2
  • 9