Solved

Linking errors

Posted on 2006-06-19
5
1,632 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now