几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-06, 05:07 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】linking in dll

linking in dll
linking in dll
i have a program which uses a number of dlls. i wish to link dwgdirect into one dll (i.e. insert the object code into that dll), and then access it from this dll and from the main program.
so far i've found the #defines _toolkit_in_dll_, oda_br_exports and oda_db_exports which it seems need to be set. are there any others or other things i need to know? so far it links ok apart from not finding the static members g_pdesc of assorted classes (e.g.oddbviewporttablerecord).

you have to define _toolkit_in_dll_ for opendwg code and for you application as well and moreover you have to define the following defines for toolkit:
oda_db_exports
odafirst_dll_exports
odw_ge_exports
oda_br_exports
i hope this will help

it looks like this isn't very easy on windows-i'd have to put all the decorated names into the .def file, which is horrible (at the moment i'd need 240 entries)! i may have to stick with the dll supplied and include that in our distribution. if this is likely to work it might be worth having a released library (i.e. a version of the dwgdirect object library) compiled for export from a dll, but there may well be some reason this doesn't work.

we experimented with creating a static lib for use in a dll a while back, and the library was huge (75+ mb for a release build). in addition, we had some strange linking problems when trying to create the dll--so it would be probably be easier for you to just use our supplied dll's. (btw, in the upcoming 1.08 release, dwgdirect will consist of several dll's rather than a single dll.) is there some reason why our supplied dll's will not work for you?


i'm using the supplied dll at the moment, so there's no reason i couldn't continue to do so. when i've got something i'm happy with i'll review the situation (i may end up moving code around so i end up with relatively few exports needed anyway-the protocol extension idea tends to move things in that direction).
i'm having the same problem. i'm trying to link a static dynamic linked library. i continue to get the following link errors:
linking...
libcpmt.lib(iostream.obj) : error lnk2005: "public: __thiscall std::ios_base::init::init(void)" (??0init@ios_base@std@@qae@xz) already defined in msvcprt.lib(msvcp60.dll)
libcpmt.lib(iostream.obj) : error lnk2005: "public: __thiscall std::ios_base::init::~init(void)" (??1init@ios_base@std@@qae@xz) already defined in msvcprt.lib(msvcp60.dll)
libcpmt.lib(locale0.obj) : error lnk2005: "public: class std::locale::facet const * __thiscall std::locale::_getfacet(unsigned int,bool)const " (?_getfacet@locale@std@@qbepbvfacet@12@i_n@z) already defined in msvcprt.lib(msvcp60.dll)
libcpmt.lib(locale0.obj) : error lnk2005: "public: bool __thiscall std::locale::_iscloc(void)const " (?_iscloc@locale@std@@qbe_nxz) already defined in msvcprt.lib(msvcp60.dll)
libcpmt.lib(ios.obj) : error lnk2005: "public: void __thiscall std::ios_base::clear(int,bool)" (?clear@ios_base@std@@qaexh_n@z) already defined in msvcprt.lib(msvcp60.dll)
libcmt.lib(crt0init.obj) : error lnk2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
libcmt.lib(crt0init.obj) : error lnk2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
libcmt.lib(crt0init.obj) : error lnk2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
libcmt.lib(crt0init.obj) : error lnk2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: virtual __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::~basic_filebuf<char,struct std::char_traits<char> >(void)" (??1?$basic_filebuf@du?$char_traits@d@std@@@std@@u ae@xz) alread
y defined in libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@du?$char_traits@d@std@@@std@@uae@x z) already defined in
libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "protected: void __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::_init(struct _iobuf *,enum std::basic_filebuf<char,struct std::char_traits<char> >::_initfl)" (?_init@?$basic_filebuf@du?$
char_traits@d@std@@@std@@iaexpau_iobuf@@w4_initfl@ 12@@z) already defined in libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::basic_filebuf<char,struct std::char_traits<char> >(struct _iobuf *)" (??0?$basic_filebuf@du?$char_traits@d@std@@@std@@q ae@pau_iobu
f@@@z) already defined in libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "protected: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::init(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (?init@?$basic_ios@du?$char_traits@d@std@@@std@@
iaexpav?$basic_streambuf@du?$char_traits@d@std@@@2 @_n@z) already defined in libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@
du?$char_traits@d@std@@v?$allocator@d@2@@std@@qae@ xz) already defined in exhostappservices.obj
msvcprt.lib(msvcp60.dll) : error lnk2005: "private: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_grow(unsigned int,bool)" (?_grow@?$basic_string@du?$char_traits@d@std@@v?$a llocator@d@2@@std@@aae
_ni_n@z) already defined in exhostappservices.obj
msvcprt.lib(msvcp60.dll) : error lnk2005: "protected: void __thiscall std::ios_base::_init(void)" (?_init@ios_base@std@@iaexxz) already defined in libcpmt.lib(ios.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl stderator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??6std@@yaaav?$basic_ostream@du?$char_
traits@d@std@@@0@aav10@pbd@z) already defined in exhostappservices.obj
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@std@@uae@xz) already defined in libcpmt.lib(ios.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class basic_ostream<char,struct std::char_traits<char> >::basic_streambuf<char,
struct std::char_traits<char> > *,bool,bool)" (??0?$basic_ostream@du?$char_traits@d@std@@@std@@q ae@pav?$basic_streambuf@du?$char_traits@d@std@@@1@ _n1@z) already defined in libcpmt.lib(iostream.obj)
msvcprt.lib(msvcp60.dll) : error lnk2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >erator<<(int)" (??6?$basic_ostream@du?$char_traits@d@std@@@std@@
qaeaav01@h@z) already defined in exhostappservices.obj
link : warning lnk4098: defaultlib "libcmt" conflicts with use of other libs; use /nodefaultlib:library
link : warning lnk4098: defaultlib "msvcrt" conflicts with use of other libs; use /nodefaultlib:library
release/xref.dll : fatal error lnk1169: one or more multiply defined symbols found
error executing link.exe.
xref.dll - 22 error(s), 2 warning(s)
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】error while linking using mfc static library vc 96.00 yang686526 DirectDWG 0 2009-05-05 09:49 AM
【转帖】DllMain详解 huangyhg vc编程 0 2009-03-22 11:12 PM
【转帖】dll学习(资料收集) huangyhg vc编程 0 2008-05-17 09:24 PM
最难清除木马 Dll木马揭秘 huangyhg vc编程 0 2007-04-12 07:31 PM
regsvr32.exe的使用 cam 论坛管理 0 2007-02-27 11:07 PM


所有的时间均为北京时间。 现在的时间是 05:54 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多