Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1680
  • Last Modified:

Linking errors

Hi,

I have an application that connects to COM servers to process certain information.  I did not set this part up myself.  It was already set up this way when I joined.  I'm now trying to use these servers in a separate project.  I went through the project that already had the servers set up and tried to do the same to my new project.  As far as I can tell, everything is the same (i.e. all files and libraries have been added to my project) but I must be forgetting something.  

I'm getting the following link errors when I compile:

Linking...
dlldata.obj : error LNK2001: unresolved external symbol __imp__NdrDllGetClassObject@24
dlldata.obj : error LNK2001: unresolved external symbol __imp__NdrDllCanUnloadNow@4
dlldata.obj : error LNK2001: unresolved external symbol _NdrCStdStubBuffer_Release@8
dlldata.obj : error LNK2001: unresolved external symbol _NdrCStdStubBuffer2_Release@8
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_DebugServerRelease@8
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_DebugServerQueryInterface@8
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_CountRefs@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_IsIIDSupported@8
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_Invoke@12
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_Disconnect@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_Connect@8
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_AddRef@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _CStdStubBuffer_QueryInterface@12
SvrTools_p.obj : error LNK2001: unresolved external symbol _NdrStubCall2@16
SvrTools_p.obj : error LNK2001: unresolved external symbol _NdrStubForwardingFunction@16
SvrTools_p.obj : error LNK2001: unresolved external symbol _IUnknown_Release_Proxy@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _IUnknown_AddRef_Proxy@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _IUnknown_QueryInterface_Proxy@12
SvrTools_p.obj : error LNK2001: unresolved external symbol _NdrOleFree@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _NdrOleAllocate@4
SvrTools_p.obj : error LNK2001: unresolved external symbol _NdrClientCall2

Can anyone help me out?

Thanks
0
StanChart
Asked:
StanChart
  • 4
1 Solution
 
jkrCommented:
VisualStudio (or, to be more precise 'MIDL') will generate some files when building your app which contain references to these symbol. Add

#pragma comment(lib,"rpcndr.lib")

to your source code or add "rpcndr.lib" manually to your project.
0
 
jkrCommented:
Sorry, I forgot, you should also link with "rpcrt4.lib", i.e.

#pragma comment(lib,"rpcrt4.lib")

(or, as above, add that to your project manually)
0
 
StanChartAuthor Commented:
dude, you are the fken man!!  I spent a lot of time on this going through my project making sure I didn't forget anything.  I don't see this in my other project though. Any ideas why that works without these libs?
0
 
jkrCommented:
Huh, that depends. MIDL might have already added that to the files upon generation, or they are already listed as part of the "default libraries" in the linker option. Mybe you started out with a different project type.
0
 
jkrCommented:
Any other problems here?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now