x32 与 x64 的库名称
我有一个支持 x32 和 x64 平台的 C++ 静态库。
我的问题是:我应该根据哪个平台对 .lib 文件命名不同吗?
即 MyLib32.lib 与 MyLib64.lib
英特尔数学库和 TBB 使用文件夹名称来区分这两个库来处理此问题。
即 x32\Math.lib vs x64\Math.lib
与其他方法相比是否有更好的方法?
我认为明确命名库以对应于预期的平台应该更好? 这样我们就不依赖于文件夹名称,并且库是自记录的。
I have a C++ static library that supports both x32 and x64 platforms.
My question is: should I name the .lib file different depending on which platform?
i.e. MyLib32.lib vs MyLib64.lib
Intel Math library and TBB handle this using folder name to differentiate between the 2 libraries instead.
i.e. x32\Math.lib vs x64\Math.lib
Is there a better way compared to the other?
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
善待您的用户,并按照您的建议在末尾添加 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.
我最近做了很多 32 和 64 位工作,我肯定更喜欢不同的名称。
I've been doing a lot of 32 and 64 bit work lately and I definitely prefer different names.
不,我不认为一种方法优于另一种方法,并且我认为您已经正确地列举了每种方法的两个差异。
然而,根据我的经验,许多库具有相同的名称,但保存在单独的文件夹中,并分布在单独的 zip 文件中。
例如,sourceforge 上的 LPSolve 的二进制文件名称相同,无论平台如何。
No, I don't think that one approach is superior to the other, and I think you've properly enumerated the two differences in each.
From my experience, however, many libraries have the same name, but are kept in either separate folders and are distributed in separate zip files.
LPSolve on sourceforge, for example, has their binaries named the same, regardless of platform.