Unresolved external symol __im__RpcServerListn
I already included Rpc.h
, but I am still receiving error LNK2019: unresolved external symbol __im__RpcServerListen@12 referenced in function _main
. Is there an开发者_开发知识库ything else I need to do to be able to call this function?
It's not enough to include the header file, that just tells the compiler about the types, functions and so on, that you want to use.
You also have to link with the relevant object files or libraries since they contain the actual code that you will be calling. You can tell this because the error starts with LNK
, meaning you have a linker issue rather than a compiler one.
The actual files that you need to link to should be specified for the linking phase. For Windows RPC, this appears to be rpcrt4.lib
(see here).
精彩评论