1 错误LNK2019 未解析的外部符号swscanf_s在函数private:bool __cdecl MFX :: MFXPluginsInFS ::中引用ParseKVPair(wchar_t *,wchar_t *,类MFX :: PluginDescriptionRecord&)( ?ParseKVPair @ MFXPluginsInFS @ MFX @@ AEAA_NPEA_W0AEAVPluginDescriptionRecord @ 2 @@ Z) ScreenCapture ~ \Visual Studio \ ScreenCapture\ScreenCapture\libmfx.lib(mfx_plugin_hive .obj) 1 警告LNK4098 defaultlib'LIBCMT'与使用其他库冲突; use / NODEFAULTLIB:library ScreenCapture ~ \ Visis Studio \ ScreenCapture \ ScreenCapture \ LINK 1 但是,在Visual Studio 2012中,上述代码运行正常。请告知我该如何将我的项目升级到Visual Studio 2015? 我尝试了什么: 我在Visual Studio 2017RC中面对LNK2019(参考这里)所以我回滚到Visual Studio 2015和2012.可用于此论坛或其他论坛上的错误的解决方案对我不起作用。为了警告LNK4098,我无法断定要忽略哪些库。I made the project in Visual Studio 2015 but received following errorsSeverity Error CodeDescriptionProjectFile pathProgram LineThe errors have been written in above format.Error LNK1120 2 unresolved externals ScreenCapture ~\Visual Studio\ScreenCapture\x64\Debug\ScreenCapture.exe 1Error LNK2019 unresolved external symbol __imp_printf referenced in function main ScreenCapture ~\Visual Studio\ScreenCapture\ScreenCapture\main.obj 1Error LNK2019 unresolved external symbol swscanf_s referenced in function "private: bool __cdecl MFX::MFXPluginsInFS::ParseKVPair(wchar_t *,wchar_t *,class MFX::PluginDescriptionRecord &)" (?ParseKVPair@MFXPluginsInFS@MFX@@AEAA_NPEA_W0AEAVPluginDescriptionRecord@2@@Z) ScreenCapture ~\Visual Studio\ScreenCapture\ScreenCapture\libmfx.lib(mfx_plugin_hive.obj) 1Warning LNK4098 defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library ScreenCapture ~\Visual Studio\ScreenCapture\ScreenCapture\LINK 1However, in Visual Studio 2012 the aforementioned code runs fine. Please advise what should I do to upgrade my project to Visual Studio 2015?What I have tried:I faced LNK2019 in Visual Studio 2017RC (Refer here) so I rolled back to Visual Studio 2015 and 2012. Solutions available for the errors on this or other forums are not working for me. For warning LNK4098, I couldn't conclude which libraries to ignore.推荐答案 LNK4098 表示预期LIBC版本之间不匹配通过程序的各个组件。它通常发生在针对静态LIBC编译一个静态库时,另一个库(或主程序)是针对DLL版本编译的。 为了修复这样,查看主程序的配置,以及解决方案中的每个库/ DLL。它们应该都链接到相同的库(所有DLL,或所有静态)。如果你只有一个二进制形式的库,它的文档应该告诉你它需要哪个版本的库。 一旦你完成了这个,所有其他的问题应该也可以自行解决。LNK4098 means that there is a mismatch between versions of LIBC expected by various components of your program. It typically occurs when one static library is compiled against the static LIBC, and another library (or the main program) is compiled against the DLL version.In order to fix this, look at the configuration for your main program, and for each library/DLL in your solution. They should all link against the same libraries (either all DLL, or all static). If you have a library only in binary form, its documentation should tell you which version of the library it requires.Once you have sorted this out, all other problems should sort themselves out as well. 这篇关于视觉工作室2015的错误在2012年消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-25 22:32