Solved

Linking errors

Posted on 2006-06-19
5
1,655 Views
Last Modified: 2008-01-09
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
Comment
Question by:StanChart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 16936731
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
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 16936878
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
 

Author Comment

by:StanChart
ID: 16936920
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
 
LVL 86

Expert Comment

by:jkr
ID: 16936946
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
 
LVL 86

Expert Comment

by:jkr
ID: 16986477
Any other problems here?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question