MySvr fatal error LNK1120: 1 个无法解析的外部命令
MySvr error LNK2019: 无法解析的外部符号 _HelloWorld ,该符号在函数 _RemoteHelloWorld_HelloWorld@4 中被引用sourcecode:// main.cpp
#include <iostream>
#include "MyInterface.h" // 自己定义的接口头文件
// 使用midl生成(命令行为 " midl MyInterface.idl" ,MyInterface.idl文件见下!)void Output (const char* szOutput)
{
std::cout << szOutput << std::endl;
}int main()
{
RPC_STATUS status;//represents a platform-specific status code type.
status = RpcServerUseProtseqEp ( //tells the RPC run-time library to use the specified protocol sequence
reinterpret_cast<unsigned char*>("ncacn_ip_tcp"),
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
reinterpret_cast<unsigned char*>("4747"),
NULL);
if (status) //if it sucess, it is 0L
exit(status);
status = RpcServerRegisterIf ( // register a interface
RemoteHelloWorld_v1_0_s_ifspec,
NULL,
NULL ); if(status)
exit(status); status = RpcServerListen( // listen for remote procedure calls for all registered interfaces.
1,
RPC_C_LISTEN_MAX_CALLS_DEFAULT,
FALSE );
if (status)
exit(status);}// Memory allocating functions
void* __RPC_USER midl_user_allocate (size_t size)
{
return(malloc(size));
}void __RPC_USER midl_user_free(void* p)
{
free(p);
}
// MyInterface.idl
[
uuid(b26baa87-ecfa-474d-bea8-b90caab9f941),
version(1.0)
]
interface RemoteHelloWorld
{
void HelloWorld( [ in, string] const char* szOutput);
}
MySvr error LNK2019: 无法解析的外部符号 _HelloWorld ,该符号在函数 _RemoteHelloWorld_HelloWorld@4 中被引用sourcecode:// main.cpp
#include <iostream>
#include "MyInterface.h" // 自己定义的接口头文件
// 使用midl生成(命令行为 " midl MyInterface.idl" ,MyInterface.idl文件见下!)void Output (const char* szOutput)
{
std::cout << szOutput << std::endl;
}int main()
{
RPC_STATUS status;//represents a platform-specific status code type.
status = RpcServerUseProtseqEp ( //tells the RPC run-time library to use the specified protocol sequence
reinterpret_cast<unsigned char*>("ncacn_ip_tcp"),
RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
reinterpret_cast<unsigned char*>("4747"),
NULL);
if (status) //if it sucess, it is 0L
exit(status);
status = RpcServerRegisterIf ( // register a interface
RemoteHelloWorld_v1_0_s_ifspec,
NULL,
NULL ); if(status)
exit(status); status = RpcServerListen( // listen for remote procedure calls for all registered interfaces.
1,
RPC_C_LISTEN_MAX_CALLS_DEFAULT,
FALSE );
if (status)
exit(status);}// Memory allocating functions
void* __RPC_USER midl_user_allocate (size_t size)
{
return(malloc(size));
}void __RPC_USER midl_user_free(void* p)
{
free(p);
}
// MyInterface.idl
[
uuid(b26baa87-ecfa-474d-bea8-b90caab9f941),
version(1.0)
]
interface RemoteHelloWorld
{
void HelloWorld( [ in, string] const char* szOutput);
}
解决方案 »
- 把dc转化为位图文件!只能用画图软件查看!
- 选用什么文件型数据库比较好
- 求救!!江湖救急!!如何在程序中动态改变工具栏按钮的位置或显示状态?
- a well-defined fashion 谁能解释一下
- 想自己做一个telnet的程序?
- 请教:在使用DLL中碰到的问题!
- 为什么输入到ListCtrl中很多数据,只能保存最后一条?
- 请问能否将当前窗口旋转任意角度?急,可加值300分
- 新手提问:关于对字节移位的问题
- 关于remote data控件中的sql语言?
- 编译错误:我用VC++6.0新建一个MFC AppWizard[exe]工程,不加任何代码,按F7编译,却有4个错误
- 高分请教***如何调用dll??
那你说因该是用哪个呢?
生成的三个文件还是不行!