none
Unresolved external symbols NdrServerCall2, NdrServerCallAll referenced in function main RRS feed

  • Question

  • I get various linker errors in my RPC program and I can't find out which libraries I'm missing. 

    Error LNK2001 unresolved external symbol NdrServerCall2
    Error LNK2001 unresolved external symbol NdrServerCallAll
    Error LNK2019 unresolved external symbol __imp_RpcServerListen referenced in function main
    Error LNK2019 unresolved external symbol __imp_RpcServerRegisterIf2 referenced in function main
    Error LNK2019 unresolved external symbol __imp_RpcServerUseProtseqEpA referenced in function main

    eg. code sample inside main:

    status = RpcServerListen(
    1, // recommended minimum number of threads 
    RPC_C_LISTEN_MAX_CALLS_DEFAULT, // recommended maximum number of threads 
    FALSE); // start listening now

    if (status)
    exit(status);

    Thanks for your help in advance.

    Tuesday, October 1, 2019 8:46 AM

All replies

  • Are you linking with rpcrt4.lib? All of the functions that you mention are exported through that.

    The MSDN documentation for each function does list the required libraries. For example RpcServerListen states that it requires rpcrt4.lib in the requirements section.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    • Edited by Darran Rowe Tuesday, October 1, 2019 8:57 AM
    • Proposed as answer by Guido Franzke Tuesday, October 1, 2019 9:29 AM
    Tuesday, October 1, 2019 8:54 AM
  • Hello,

    If your issue is solved, please "Mark as answer" or "Vote as helpful" post to the appropriate answer , so that it will help other members to find solution quickly if they faces similar issue. If not, please feel free to contact us.

    Best Regards,

    Suarez Zhou

    Monday, October 14, 2019 7:40 AM