c++ - importing crypto++ in QT application and occurring linker errors? -


i trying use crypto++ sankore-3.1 qt program, i've installed qt sdk 4.8.1 using vc++ 2010 compiler.

i've compiled , built crypto++ using microsoft visual studio 2010, , have needed lib files, include .h files , dll file in hand.

i testes these library simple qt application in empty project using qt creator, added libraries .pro file , run successfully. .pro file blow:

 win32:config(release, debug|release): libs += -l$$pwd/../../dokuman/sankore- 3.1/plugins/cryptopp/win32/dll_output/release/ -lcryptopp  else:win32:config(debug, debug|release): libs += -l$$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/win32/dll_output/debug/ -lcrypto   includepath += $$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/include  dependpath += $$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/include   sources += \         main.cpp    win32:config(release, debug|release): libs += -l$$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/win32/output/release/ -lcryptlib  else:win32:config(debug, debug|release): libs += -l$$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/win32/output/debug/ -lcryptlib 

the problem occur when try import same library existing program in same development environment (qt creator) when add cryptlib.lib 183 errors occur as:

cryptlib.lib(cryptlib.obj) : error lnk2005: "public: virtual void __thiscall cryptopp::bufferedtransformation::attach(class cryptopp::bufferedtransformation *)" (?attach@bufferedtransformation@cryptopp@@uaexpav12@@z) defined in cryptopp.lib(cryptopp.dll)   

and when remove cryptlib.dll , build cryptopp.lib linker error occurs follow:

cl -c -nologo -zm200 -zc:wchar_t- \mp -o2 -md \o2 \zi -w0 -gr -ehsc -dunicode -dwin32 -dqt_largefile_support -dno_third_party_warnings -dubversion="\"1.50.b.00."\" -dubversion_rc=1,50,176,00 -dpre_release -dqt_dll -dqt_no_debug -dqt_webkit_lib -dqt_phonon_lib -dqt_script_lib -dqt_svg_lib -dqt_xmlpatterns_lib -dqt_xml_lib -dqt_gui_lib -dqt_network_lib -dqt_core_lib -dqt_have_mmx -dqt_have_3dnow -dqt_have_sse -dqt_have_mmxext -dqt_have_sse2 -dqt_thread_support -i"c:\qtsdk\desktop\qt\4.8.1\msvc2010\include\qtuitools" -i"c:\qtsdk\desktop\qt\4.8.1\msvc2010\include\qtcore" -i"c:\qtsdk\desktop\qt\4.8.1\msvc2010\include\qtnetwork" activationformp2.obj:-1: error: lnk2001: unresolved external symbol "bool (__cdecl* cryptopp::g_passigninttointeger)(class type_info const &,void *,void const *)" (?g_passigninttointeger@cryptopp@@3p6a_nabvtype_info@@paxpbx@za)    activationformp2.obj:-1: error: lnk2001: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const cryptopp::default_channel" (?default_channel@cryptopp@@3v?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@b) 

note that: when remove cryptlib.dll in test program linker problems occurs forced add , project run without error.

please me how link library qt program or wrong in doing that?

with compiler compiling qt app ? vs, mingw ? had linking , compiling problem using qt app mingw, found tutorial , worked me : https://sites.google.com/site/ievgensychov/cryptopp .

maybe can you.

bests, kevin


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -