ACE的"error LNK2019: unresolved external symbol"链接错误
沙老师 2006-09-21 12:50:16 我下的是ACE5.5版本,编译用的是“ACE_Static.sln”文件,选择的“Release”,按照《中篇:ACE程序员教程》里的第一个例子写好程序,头文件和库文件路径都设好了,附加库文件也添加了“ACEs.lib”,链接报错。为了排除设置问题,我在VS的命令提示符下用link命令手动链接,还是同样的错误。
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_SOCK_Acceptor::~ACE_SOCK_Acceptor(void)" (__imp_??1ACE_SOCK_Acceptor@@QAE@XZ) referenced in function $L28134
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_SOCK_Stream::~ACE_SOCK_Stream(void)" (__imp_??1ACE_SOCK_Stream@@QAE@XZ) referenced in function $L28134
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ACE_INET_Addr::~ACE_INET_Addr(void)" (__imp_??1ACE_INET_Addr@@UAE@XZ) referenced in function $L28134
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_SOCK_Stream::ACE_SOCK_Stream(void)" (__imp_??0ACE_SOCK_Stream@@QAE@XZ) referenced in function "public: __thiscall Server::Server(int)" (??0Server@@QAE@H@Z)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_SOCK_Acceptor::ACE_SOCK_Acceptor(class ACE_Addr const &,int,int,int,int)" (__imp_??0ACE_SOCK_Acceptor@@QAE@ABVACE_Addr@@HHHH@Z) referenced in function "public: __thiscall Server::Server(int)" (??0Server@@QAE@H@Z)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_INET_Addr::ACE_INET_Addr(void)" (__imp_??0ACE_INET_Addr@@QAE@XZ) referenced in function "public: __thiscall Server::Server(int)" (??0Server@@QAE@H@Z)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_INET_Addr::ACE_INET_Addr(unsigned short,unsigned int)" (__imp_??0ACE_INET_Addr@@QAE@GI@Z) referenced in function "public: __thiscall Server::Server(int)" (??0Server@@QAE@H@Z)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall ACE_SOCK_Stream::close(void)" (__imp_?close@ACE_SOCK_Stream@@QAEHXZ) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl ACE_Log_Msg::log(enum ACE_Log_Priority,char const *,...)" (__imp_?log@ACE_Log_Msg@@QAAHW4ACE_Log_Priority@@PBDZZ) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall ACE_Log_Msg::conditional_set(char const *,int,int,int)" (__imp_?conditional_set@ACE_Log_Msg@@QAEXPBDHHH@Z) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall ACE_SOCK_Stream::recv_n(void *,unsigned int,int,class ACE_Time_Value const *,unsigned int *)const " (__imp_?recv_n@ACE_SOCK_Stream@@QBEHPAXIHPBVACE_Time_Value@@PAI@Z) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class ACE_Log_Msg * __cdecl ACE_Log_Msg::instance(void)" (__imp_?instance@ACE_Log_Msg@@SAPAV1@XZ) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl ACE_Log_Msg::last_error_adapter(void)" (__imp_?last_error_adapter@ACE_Log_Msg@@SAHXZ) referenced in function "public: int __thiscall Server::handle_connection(void)" (?handle_connection@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall ACE_INET_Addr::get_host_name(void)const " (__imp_?get_host_name@ACE_INET_Addr@@QBEPBDXZ) referenced in function "public: int __thiscall Server::accept_connections(void)" (?accept_connections@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall ACE_SOCK_Acceptor::accept(class ACE_SOCK_Stream &,class ACE_Addr *,class ACE_Time_Value *,int,int)const " (__imp_?accept@ACE_SOCK_Acceptor@@QBEHAAVACE_SOCK_Stream@@PAVACE_Addr@@PAVACE_Time_Value@@HH@Z) referenced in function "public: int __thiscall Server::accept_connections(void)" (?accept_connections@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ACE_Time_Value::ACE_Time_Value(long,long)" (__imp_??0ACE_Time_Value@@QAE@JJ@Z) referenced in function "public: int __thiscall Server::accept_connections(void)" (?accept_connections@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned short __thiscall ACE_INET_Addr::get_port_number(void)const " (__imp_?get_port_number@ACE_INET_Addr@@QBEGXZ) referenced in function "public: int __thiscall Server::accept_connections(void)" (?accept_connections@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall ACE_SOCK::get_local_addr(class ACE_Addr &)const " (__imp_?get_local_addr@ACE_SOCK@@QBEHAAVACE_Addr@@@Z) referenced in function "public: int __thiscall Server::accept_connections(void)" (?accept_connections@Server@@QAEHXZ)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl ace_os_main_i(class ACE_Main_Base &,int,char * * const)" (__imp_?ace_os_main_i@@YAHAAVACE_Main_Base@@HQAPAD@Z) referenced in function _main
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl ACE_OS::atoi(char const *)" (__imp_?atoi@ACE_OS@@YAHPBD@Z) referenced in function "int __cdecl ace_main_i(int,char * * const)" (?ace_main_i@@YAHHQAPAD@Z)
ace_1 error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl ACE_OS::exit(int)" (__imp_?exit@ACE_OS@@YAXH@Z) referenced in function "int __cdecl ace_main_i(int,char * * const)" (?ace_main_i@@YAHHQAPAD@Z)
ace_1 fatal error LNK1120: 21 unresolved externals