Solved

Linking errors

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

776 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