找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 4468|回复: 2

小弟初次在vs2005下写ace的列子,报连接错误,请告诉帮一下

[复制链接]
发表于 2011-3-16 11:44:46 | 显示全部楼层 |阅读模式
小弟初次使用vs2005写了个ace的简单的例子,编译时出现链接错误,我看的工具-选项下ace的库路径都是对的,为什么链接不成功。谢谢啦
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall ACE_Get_Opt::~ACE_Get_Opt(void)" (__imp_??1ACE_Get_Opt@@QAE@XZ),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __cdecl ACE_Log_Msg::log(enum ACE_Log_Priority,char const *,...)" (__imp_?log@ACE_Log_Msg@@QAAHW4ACE_Log_Priority@@PBDZZ),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall ACE_Log_Msg::conditional_set(char const *,int,int,int)" (__imp_?conditional_set@ACE_Log_Msg@@QAEXPBDHHH@Z),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class ACE_Log_Msg * __cdecl ACE_Log_Msg::instance(void)" (__imp_?instance@ACE_Log_Msg@@SAPAV1@XZ),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static int __cdecl ACE_Log_Msg::last_error_adapter(void)" (__imp_?last_error_adapter@ACE_Log_Msg@@SAHXZ),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall ACE_Get_Opt::operator()(void)" (__imp_??RACE_Get_Opt@@QAEHXZ),该符号在函数 _wmain 中被引用
1>Get_Opt.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall ACE_Get_Opt::ACE_Get_Opt(int,char * *,char const *,int,int,int,int)" (__imp_??0ACE_Get_Opt@@QAE@HPAPADPBDHHHH@Z),该符号在函数 _wmain 中被引用
1>E:\ace_study\Get_Opt\Debug\Get_Opt.exe : fatal error LNK1120: 7 个无法解析的外部命令
发表于 2011-3-16 14:11:28 | 显示全部楼层
使用ACE时,你的工程是Debug模式你应该导入aced.lib,否则应该导入ace.lib,另外,编译工具版本的不同编译的ACE是不能通用的;
 楼主| 发表于 2011-3-16 14:23:04 | 显示全部楼层
问题解决:在vs2005中项目下的xx项目属性页的配置属性节点下的连接器节点下的输入项的附加依赖项添加需要的ace库:F:\ACE_wrappers\lib\ACEd.lib
就搞定了。真不容易啊,vs这玩意还真复杂。
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-17 11:55 , Processed in 0.014336 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表