链接器错误LNK2038:检测到' RuntimeLibrary'不匹配

时间:2014-10-11 11:19:49

标签: c++ qt pjsip

我在使用pjsua2.lib时遇到了一些问题。我不能在QT中构建​​它。我添加了以下库:

INCLUDEPATH += "$$DIRECTX_PATH\Include"
INCLUDEPATH+="$$SIP_PATH\pjsip\include"
INCLUDEPATH+="$$SIP_PATH\pjlib\include"
INCLUDEPATH+="$$SIP_PATH\pjlib-util\include"
INCLUDEPATH+="$$SIP_PATH\pjnath\include"
INCLUDEPATH+="$$SIP_PATH\pjmedia\include"
INCLUDEPATH+="$$SIP_PATH\pjsip-apps\src\pjsua\pjsua_app.h"
INCLUDEPATH+="$$SIP_PATH\pjsip\src\pjsua-lib\pjsua_acc.c"
LIBS += "$$DIRECTX_PATH\Lib\x86\dsound.lib"
LIBS += "$$DIRECTX_PATH\Lib\x86\dxguid.lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\WS2_32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\Ole32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\WSock32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\IPHlpApi.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\NetAPI32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\AdvAPI32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\Gdi32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\User32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\odbccp32.lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\odbc32.lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\msvfw32.Lib"
LIBS+="$$WINDOWS_SDKS_PATH\Lib\Version.Lib"
LIBS+="$$SIP_PATH\lib\libpjproject-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjsip\lib\pjsip-core-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjsip\lib\pjsip-simple-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjsip\lib\pjsip-ua-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjsip\lib\pjsua2-lib-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjsip\lib\pjsua-lib-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjlib\lib\pjlib-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjlib-util\lib\pjlib-util-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjmedia\lib\pjmedia-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjnath\lib\pjnath-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libbaseclasses-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libg7221codec-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libgsmcodec-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libilbccodec-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libmilenage-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libportaudio-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libresample-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libspeex-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\third_party\lib\libsrtp-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjmedia\lib\pjmedia-audiodev-i386-Win32-vc8-Debug.lib"
LIBS+="$$SIP_PATH\pjmedia\lib\pjmedia-codec-i386-Win32-vc8-Debug.lib"

但是每当我尝试构建应用程序时都会出现这些错误:

pjsua2-lib-i386-Win32-vc8-Debug.lib(endpoint.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in main.obj

我认为问题来自编译器,但无论如何,我似乎无法解决它

1 个答案:

答案 0 :(得分:2)

这意味着您链接到的库已使用CRT(C运行时)的不同版本/变体构建。您需要重建库或将项目属性中的运行时库版本+变体(发布/调试,DLL /静态)设置为与要链接的所有库相同的设置。