使用VS2015链接静态库 [英] Linking against static lib with VS2015

查看:1428
本文介绍了使用VS2015链接静态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是使用2015工具集构建的静态库,使用2017构建我的DLL。在该配置中 - 并希望支持 - 我收到链接器错误,指出它无法找到从静态lib导出的符号,我正在联系。当我使用2015工具集切换到
构建我的DLL时,这对我来说似乎是明显的补救措施,我从链接器中得到以下错误:


LINK:致命错误C1007 :'p2'中无法识别的标志'-Ot'


当我在VS中查看项目属性页中的命令行时,我找不到任何我传入的内容。 / p>

在线阅读文档,似乎我应该能够将2017工具集与使用2015工具集创建的静态库链接。那是对的吗?如果没有,我如何摆脱无法识别的标志错误?


谢谢,

解决方案

b


感谢您在此发布。


> ;>我使用的是使用2015工具集构建的静态库,使用2017构建我的DLL。在该配置中 - 并且希望支持 - 我得到链接器错误,指出它无法找到从静态库导出的符号,我正在链接。
当我使用2015工具集切换到构建我的DLL时,这对我来说似乎是明显的补救措施,我从链接器中得到以下错误:...


"Ot"可能是一种优化,看看这个。




有人修复了此错误,对不起尝试将Visual Studio更新到最新版本? 


祝福,祝你好运b $ b


<张杰杰。


I am using a static lib built with the 2015 toolset, building my DLL using 2017. In that configuration - and hoping that is supported - I get linker errors stating it can't find symbols exported from the static lib, I am linking against. When I switch to building my DLL using the 2015 toolset, which seemed like the obvious remedy to me, I get the following error from the linker:

LINK: fatal error C1007: unrecognized flag '-Ot' in 'p2'

I don't find anywhere I pass in -Ot when I look at the commandline in the property pages of the project in VS.

Reading the docs online, it seems that I should be able to link with the 2017 toolset against a static lib created with the 2015 toolset. Is that correct? If not, how do I get rid of that unrecognized flag error?

Thanks,

解决方案

Hi,

Thanks for posting here.

>> I am using a static lib built with the 2015 toolset, building my DLL using 2017. In that configuration - and hoping that is supported - I get linker errors stating it can't find symbols exported from the static lib, I am linking against. When I switch to building my DLL using the 2015 toolset, which seemed like the obvious remedy to me, I get the following error from the linker: ...

The "Ot" may be a kind of Optimization, look at this.

Someone had fixed this error, have you tried updating Visual Studio to the latest version? 

Best Wishes,

Jack Zhang.


这篇关于使用VS2015链接静态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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