本文介绍了x32与x64的库名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个同时支持x32和x64平台的C ++静态库.

I have a C++ static library that supports both x32 and x64 platforms.

我的问题是:根据哪个平台,我是否应该对.lib文件命名不同?

My question is: should I name the .lib file different depending on which platform?

即MyLib32.lib与MyLib64.lib

i.e. MyLib32.lib vs MyLib64.lib

Intel Math库和TBB使用文件夹名称来处理此问题,以区分两个库.

Intel Math library and TBB handle this using folder name to differentiate between the 2 libraries instead.

即x32 \ Math.lib与x64 \ Math.lib

i.e. x32\Math.lib vs x64\Math.lib

与其他方法相比,还有更好的方法吗?

Is there a better way compared to the other?

我认为明确命名lib以对应于预期的平台应该更好吗?这样,我们就不必依赖文件夹名称,而lib可以自我记录.

I think explicitly naming the lib to correspond to the intended platform should be better? That way we dont depend on folder name and the lib is self-documenting.

推荐答案

对您的用户好,并像您建议的那样在末尾添加32或64.乍一看,这绝对是100%的意思,您永远也不会混淆.

Be nice to your users and add 32 or 64 to the end like you propose. It's absolutely 100% clear what it means at first glance and you'll never mix them up.

这篇关于x32与x64的库名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 22:45