guilib(guitoolkit) 如何使用它的静态库?有高手实现过吗?

Kaile 2005-09-03 10:18:13
请高手指点:
guilib(guitoolkit)是一个著名的UI库,提供静态库和dll调用,但是为什么它提供的例子中的静态库它的例子里无法使用(例子里原来用得是dll,我想改成lib)。

它的头文件是这样设计的:

#if defined _AFXDLL && !defined _GUILIB_STATIC_
#ifdef GUILIB_EXPORTS
#define GUILIBDLLEXPORT _declspec(dllexport)
#else
#define GUILIBDLLEXPORT _declspec(dllimport)
#endif
#else
#define GUILIBDLLEXPORT
#endif


#ifndef _GUILIB_NOAUTOLIB

#if defined _AFXDLL && !defined _GUILIB_STATIC_
// MFC shared DLL with GuiToolKit shared DLL
#ifdef _DEBUG
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115ud.lib")
#pragma message("Automatically linking with GuiTk115ud.dll")
#else
#pragma comment(lib,"GuiTk115d.lib")
#pragma message("Automatically linking with GuiTk115d.dll")
#endif
#else
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115u.lib")
#pragma message("Automatically linking with GuiTk115u.dll")
#else
#pragma comment(lib,"GuiTk115.lib")
#pragma message("Automatically linking with GuiTk115.dll")
#endif
#endif
#elif defined _GUILIB_STATIC_
// MFC shared DLL with GuiToolKit static library
#ifdef _DEBUG
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115Staticuds.lib")
#pragma message("Automatically linking with static GuiTk115Staticuds.lib")
#else
#pragma comment(lib,"GuiTk115Staticds.lib")
#pragma message("Automatically linking with static GuiTk115Staticds.lib")
#endif
#else
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115Staticus.lib")
#pragma message("Automatically linking with static GuiTk115Staticus.lib")
#else
#pragma comment(lib,"GuiTk115Statics.lib")
#pragma message("Automatically linking with static GuiTk115Statics.lib")
#endif
#endif
#else
// MFC static library with GuiToolKit static library
#ifdef _DEBUG
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115Staticud.lib")
#pragma message("Automatically linking with static GuiTk115Staticud.lib")
#else
#pragma comment(lib,"GuiTk115Staticd.lib")
#pragma message("Automatically linking with static GuiTk115Staticd.lib")
#endif
#else
#ifdef _UNICODE
#pragma comment(lib,"GuiTk115Staticu.lib")
#pragma message("Automatically linking with static GuiTk115Staticu.lib")
#else
#pragma comment(lib,"GuiTk115Static.lib")
#pragma message("Automatically linking with static GuiTk115Static.lib")
#endif
#endif
#endif

我已经解定义了_AFXDLL,定义了_staticlib, 把我的工程改为使用MFC静态库,但是还是出现链接错误。

下载地址:
http://www.beyondata.com/
...全文
212 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kaile 2005-09-08
  • 打赏
  • 举报
回复
另外,我用得是VC .Net 2003
Kaile 2005-09-08
  • 打赏
  • 举报
回复
按照您的方法,出现以下错误:

CGuiAccess error LNK2005: "int __stdcall _AfxGetDropDownWidth(void)" (?_AfxGetDropDownWidth@@YGHXZ) 已经在 GuiTk115Static.lib(GuiToolBarWnd.obj) 中定义
CGuiAccess error LNK2005: "int _afxDropDownWidth" (?_afxDropDownWidth@@3HA) 已经在 GuiTk115Static.lib(GuiToolBarWnd.obj) 中定义
CGuiAccess error LNK2005: "void __stdcall _AfxAdjustRectangle(class CRect &,class CPoint)" (?_AfxAdjustRectangle@@YGXAAVCRect@@VCPoint@@@Z) 已经在 GuiTk115Static.lib(GuiDockContext.obj) 中定义
CGuiAccess error LNK2019: 无法解析的外部符号 "public: __thiscall CVisualStylesXP::~CVisualStylesXP(void)" (??1CVisualStylesXP@@QAE@XZ) ,该符号在函数 "public: static int __cdecl GuiDrawLayer::IsThemeXP(void)" (?IsThemeXP@GuiDrawLayer@@SAHXZ) 中被引用
CGuiAccess error LNK2019: 无法解析的外部符号 "public: __thiscall CVisualStylesXP::~CVisualStylesXP(void)" (??1CVisualStylesXP@@QAE@XZ) ,该符号在函数 "public: static int __cdecl GuiDrawLayer::IsThemeXP(void)" (?IsThemeXP@GuiDrawLayer@@SAHXZ) 中被引用
CGuiAccess error LNK2019: 无法解析的外部符号 "public: int __thiscall CVisualStylesXP::IsAppThemed(void)" (?IsAppThemed@CVisualStylesXP@@QAEHXZ) ,该符号在函数 "public: static int __cdecl GuiDrawLayer::IsThemeXP(void)" (?IsThemeXP@GuiDrawLayer@@SAHXZ) 中被引用
CGuiAccess error LNK2019: 无法解析的外部符号 "public: int __thiscall CVisualStylesXP::IsAppThemed(void)" (?IsAppThemed@CVisualStylesXP@@QAEHXZ) ,该符号在函数 "public: static int __cdecl GuiDrawLayer::IsThemeXP(void)" (?IsThemeXP@GuiDrawLayer@@SAHXZ) 中被引用
CGuiAccess error LNK2019: 无法解析的外部符号 "public: __thiscall CVisualStylesXP::CVisualStylesXP(void)" (??0CVisualStylesXP@@QAE@XZ) ,该符号在函数 "public: static int __cdecl GuiDrawLayer::IsThemeXP(void)" (?IsThemeXP@GuiDrawLayer@@SAHXZ) 中被引用
CGuiAccess error LNK2019: 无法解析的外部符号 "public: __thiscall CVisualStylesXP::CVisualStylesXP(void)" (??0CVisualStylesXP@@QAE@XZ) ,该符号在函数 __ehhandler$?IsThemeXP@GuiDrawLayer@@SAHXZ 中被引用
CGuiAccess fatal error LNK1120: 3 个无法解析的外部命令
Kaile 2005-09-06
  • 打赏
  • 举报
回复
呼唤高手
masterz 2005-09-06
  • 打赏
  • 举报
回复
对于CGuiAccess工程,在VC++ IDE的FileView tab把GuiLib删掉
给工程加上_GUILIB_STATIC_宏定义
修改apps-Sourcecode\GuiLib1.5\GuiLib\GuiLib.h
#pragma comment(lib,"GuiTk115Static.lib")
// #pragma comment(lib,"GuiTk115Statics.lib")
注意没有GuiTk115Statics.lib这个文件,只有GuiTk115Static.lib
上面的修改是针对release配置的。
Kaile 2005-09-05
  • 打赏
  • 举报
回复
急!!!
Kaile 2005-09-04
  • 打赏
  • 举报
回复
有办法调用它的静态库吗?急!
jenycheng 2005-09-03
  • 打赏
  • 举报
回复
可能是它自己动态的调用了其他的库吧

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧