Library name for x32 vs x64

柔情痞子 提交于 2019-12-11 02:44:48

问题


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.


回答1:


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.




回答2:


I've been doing a lot of 32 and 64 bit work lately and I definitely prefer different names.




回答3:


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.



来源:https://stackoverflow.com/questions/739023/library-name-for-x32-vs-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!