سؤال

أقوم بتطوير التطبيق باستخدام VC ++ 6.

لدي DLL الطرف الثالث. تم تجميع هذه المكتبة على أنها DLL Multihded DLL (/MD) وتطبيقي أيضًا. لكني فشلت في الارتباط:

LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO specification
msvcprtd.lib(MSVCP60D.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_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in XXXApi.lib(CODbg.obj)
msvcprtd.lib(MSVCP60D.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> >(class std::basic_string<c
har,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in XXXApi.lib(Dictionary.obj)
../../Exes/win2k3_oracle11/XXX.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

من عند هنا أرى أنه على الرغم من أن المكتبة الثالثة والرمز الخاص بي تم تجميعها كـ /MD ، فربما يكون هناك تعارض مع Beining IoStream القديم /الجديد المستخدم.

هل هناك طريقة لتحديد مكتبة IoStream القديمة/الجديدة التي تستخدمها مكتبة الطرف الثالث؟

UPD:Lib الطرف الثالث ثابت وليست ديناميكية كما اعتقدت من قبل. تم تجميع LIB /MD. تبعية ووكر تعمل wirh dlls وليس أي ليبس.

هل كانت مفيدة؟

المحلول

هناك تبعية ووكر ، إذا كنت لا تعرف هذه الأداة.http://dependencywalker.com/

اسحب وإسقاط DLL أو exe على النافذة الرئيسية. سوف تظهر جميع التبعيات.

وإذا كنت ترغب في الارتباط بحفلة ثالثة DLL ، فكل ما تحتاجه هو .lib مصنوع لهذا DLL. إذا لم يكن لديك هذا .lib ، فيمكنك دائمًا إنشاء واحدة باستخدام lib.exe أو polib.exe من أدوات Pelles C. Polib أسهل في الاستخدام لأنك لست بحاجة إلى كتابة ملف .def.http://www.smorgasbordet.com/pellesc/

آمل أن يساعد ذلك على سؤالك.

تحرير: هل لديك رمز المصدر لـ .lib الذي تستخدمه؟

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top