将项目移至VS2015 - 解决链接器错误 [英] Moving project to VS2015 - solving linker errors

查看:83
本文介绍了将项目移至VS2015 - 解决链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的命令行程序,直到现在在Windows 7的VS2013下开发。它使用Maxim的One Wire Public Domain API和WinUSB。它在VS2013下完美构建。现在我试图将它移动到运行Windows
8.1和VS2015的新计算机上。当我尝试在此环境中构建它时,它会因以下链接器错误而失败:

I have a small command line program that I have until now been developing under VS2013 in Windows 7. It uses Maxim's One Wire Public Domain API and WinUSB. It builds perfectly well under VS2013. Now I am trying to move it to a new computer running Windows 8.1 and VS2015. When I try to build it in this environment, it fails with the following linker errors:

1> ------构建已启动:项目:readtemp5,配置:调试Win32 - ----

1> presshum.obj:警告LNK4217:本地定义的符号_printf在函数_print_array中导入

1> readtemp.obj:警告LNK4049:本地定义的符号_printf导入

1> presshum.obj:警告LNK4217:本地定义的符号_sprintf_s在函数_ReadPressHum中导入

1> readtemp.obj:警告LNK4049:本地定义的符号_sprintf_s导入

1> temp10.obj:警告LNK4049:本地定义的符号_sprintf_s已导入

1> presshum.obj:警告LNK4217:本地定义的符号_sprintf在函数_ReadPressHum中导入

1> temp10.obj:警告LNK4049:本地定义的符号_sprintf导入

1> readtemp.obj:警告LNK4217:在函数_main中导入的本地定义的符号_fprintf
1 GT; readte mp.obj:错误LNK2019:函数_main中引用的未解析的外部符号__imp____iob_func

1> readtemp.obj:错误LNK2019:函数_mainx中引用的未解析的外部符号__imp__scanf

1> readtemp.obj:错误LNK2019:未解析的外部符号__imp__sscanf在函数_main中引用

1> readtemp.obj:错误LNK2001:未解析的外部符号_owErrorStack

1> readtemp.obj:错误LNK2001:未解析的外部符号_owErrorPointer

1> readtemp.obj:错误LNK2001:未解析的外部符号_owErrorMsg

1> D:\ XPS_8700扩展文件\Users\ RowanB\Documents\Visual Studio 2015 \Projects \readtemp5 \readtemp5 \Debug \readtemp5.exe:致命错误LNK1120:6个未解析的外部因素

======== ==构建:0成功,1失败,0最新,0跳过==========

1>------ Build started: Project: readtemp5, Configuration: Debug Win32 ------
1>presshum.obj : warning LNK4217: locally defined symbol _printf imported in function _print_array
1>readtemp.obj : warning LNK4049: locally defined symbol _printf imported
1>presshum.obj : warning LNK4217: locally defined symbol _sprintf_s imported in function _ReadPressHum
1>readtemp.obj : warning LNK4049: locally defined symbol _sprintf_s imported
1>temp10.obj : warning LNK4049: locally defined symbol _sprintf_s imported
1>presshum.obj : warning LNK4217: locally defined symbol _sprintf imported in function _ReadPressHum
1>temp10.obj : warning LNK4049: locally defined symbol _sprintf imported
1>readtemp.obj : warning LNK4217: locally defined symbol _fprintf imported in function _main
1>readtemp.obj : error LNK2019: unresolved external symbol __imp____iob_func referenced in function _main
1>readtemp.obj : error LNK2019: unresolved external symbol __imp__scanf referenced in function _mainx
1>readtemp.obj : error LNK2019: unresolved external symbol __imp__sscanf referenced in function _main
1>readtemp.obj : error LNK2001: unresolved external symbol _owErrorStack
1>readtemp.obj : error LNK2001: unresolved external symbol _owErrorPointer
1>readtemp.obj : error LNK2001: unresolved external symbol _owErrorMsg
1>D:\XPS_8700 Extended Files\Users\RowanB\Documents\Visual Studio 2015\Projects\readtemp5\readtemp5\Debug\readtemp5.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我想这意味着我没有新计算机上的某些库或DLL,o它不在预期的位置,或者我没有正确设置一些项目属性以指向新系统上的文件。我已经在
的新计算机上安装了WDK,但它并没有将这些文件放在原来的位置(在C:\ WinDDK中)。我根本找不到文件......它们应该在Win8.1 / VS2015中的哪个位置?

I suppose that this means that I do not have some library or DLL on the new computer, or it is not in the location expected, or that I have failed to set up some project properties correctly to point to the files on the new system. I have installed WDK on the new computer, but it didn't put the files in the same place as they were on the old one (in C:\WinDDK). I can't actually find the files at all... Where should they be in Win8.1/VS2015?

错误消息"本地定义的符号XXX导入"是什么?实际意味着什么?

What does the error message "locally defined symbol XXX imported" actually mean?

带下划线的符号有哪些规则?如何找到导致这些错误的原始符号?

What are the rules for the symbols with underscores in them? How do I find the original symbols that are giving rise to these errors?

我真的需要一些帮助才能知道如何解决这个问题或如何进一步调查错误。

I really need some help to know how to solve this problem or how to investigate further what is wrong.

感谢您的帮助。

Rowan

推荐答案

来自 https://msdn.microsoft.com/en-us/library/ bb531344.aspx


这篇关于将项目移至VS2015 - 解决链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆